//
// PlayerObject::init from 0x63d500 to 0x63e888 (5000 bytes)
//
// 2 xrefs:
// > PlayerObject::create @ 0x63f334
// > ??> @ 0x53148
//
// 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 PlayerObject::init(PlayerObject *a1, int a2, int a3, GJBaseGameLayer *a4, cocos2d::CCLayer *a5, bool a6)
{
_BOOL4 v8; // w24
unsigned int v9; // w22
unsigned int v10; // w23
GameManager *v11; // x0
GameManager *v12; // x0
GameManager *v13; // x0
cocos2d::CCString *v14; // x0
char *CString; // x0
cocos2d::CCString *v16; // x0
char *v17; // x0
bool v18; // w27
char *v19; // x0
char *v20; // x0
cocos2d::CCNode *v22; // x0
cocos2d::CCNode_vtbl *v23; // x2
GameManager *v24; // x0
GameManager *v25; // x0
GameManager *v26; // x0
GameStatsManager *v27; // x0
GameStatsManager *v28; // x0
GameStatsManager *v29; // x0
int v30; // w0
cocos2d::CCArray *v31; // x0
cocos2d::CCSprite *v32; // x0
cocos2d::CCNode *m_mainLayer; // x3
cocos2d::CCSprite *v34; // x0
cocos2d::CCSprite *m_iconSprite; // x3
cocos2d::CCSprite *m_iconSpriteSecondary; // x24
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCSprite *v38; // x0
cocos2d::CCSprite *v39; // x3
cocos2d::CCSprite *m_iconSpriteWhitener; // x24
void (__fastcall *v41)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCString *v42; // x0
char *v43; // x0
char *v44; // x0
cocos2d::CCString *v45; // x0
char *v46; // x0
cocos2d::CCString *v47; // x0
char *v48; // x0
cocos2d::CCSprite *v49; // x0
cocos2d::CCNode *v50; // x3
cocos2d::CCSprite *v51; // x0
cocos2d::CCSprite *m_vehicleSprite; // x3
cocos2d::CCSprite *m_vehicleSpriteSecondary; // x26
void (__fastcall *v54)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCSprite *v55; // x0
cocos2d::CCSprite *v56; // x3
cocos2d::CCSprite *m_birdVehicle; // x26
void (__fastcall *v58)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCSprite *v59; // x0
cocos2d::CCSprite *v60; // x3
cocos2d::CCSprite *m_vehicleSpriteWhitener; // x26
void (__fastcall *v62)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCString *v63; // x0
char *v64; // x0
void *v65; // x0
GameManager *v66; // x0
PlayerFireBoostSprite *v67; // x0
cocos2d::CCNode *v68; // x3
GameManager *v69; // x0
__int64 i; // x26
PlayerFireBoostSprite *v71; // x24
int v72; // w3
PlayerFireBoostSprite_vtbl *v73; // x2
PlayerFireBoostSprite *m_swingFireMiddle; // x26
void (__fastcall *v75)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
PlayerFireBoostSprite *m_swingFireBottom; // x26
void (__fastcall *v77)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
PlayerFireBoostSprite *m_swingFireTop; // x26
void (__fastcall *v79)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
GameObject *v80; // x0
cocos2d::CCDictionary *v81; // x0
cocos2d::CCDictionary *v82; // x0
cocos2d::CCDictionary *v83; // x0
cocos2d::CCDictionary *v84; // x0
cocos2d::CCArray *v85; // x0
cocos2d::CCArray *v86; // x0
GJActionManager *v87; // x0
bool v88; // w2
cocos2d::CCParticleSystemQuad *v89; // x0
cocos2d::CCParticleSystemQuad_vtbl *v90; // x2
bool v91; // w2
cocos2d::CCParticleSystemQuad *v92; // x0
cocos2d::CCParticleSystemQuad_vtbl *v93; // x2
bool v94; // w2
cocos2d::CCParticleSystemQuad *v95; // x0
cocos2d::CCParticleSystemQuad_vtbl *v96; // x2
bool v97; // w2
cocos2d::CCParticleSystemQuad *v98; // x0
cocos2d::CCParticleSystemQuad_vtbl *v99; // x2
bool v100; // w2
cocos2d::CCParticleSystemQuad *v101; // x0
cocos2d::CCParticleSystemQuad_vtbl *v102; // x2
float v103; // s0
cocos2d::CCParticleSystemQuad *m_trailingParticles; // x26
bool v105; // w2
cocos2d::CCParticleSystemQuad *v106; // x0
cocos2d::CCParticleSystemQuad_vtbl *v107; // x2
cocos2d::CCParticleSystemQuad *v108; // x26
void (__fastcall *setSpeed)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v110; // s0
cocos2d::CCParticleSystemQuad *v111; // x26
void (__fastcall *setSpeedVar)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v113; // s0
cocos2d::CCParticleSystemQuad *m_shipClickParticles; // x26
void (__fastcall *v115)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCParticleSystemQuad *v116; // x26
void (__fastcall *v117)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v118; // s0
cocos2d::CCParticleSystemQuad *v119; // x26
void (__fastcall *v120)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v121; // s0
cocos2d::CCParticleSystemQuad *v122; // x26
void (__fastcall *setAngleVar)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v124; // s0
cocos2d::CCParticleSystemQuad *v125; // x26
void (__fastcall *setStartSize)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v127; // s0
cocos2d::CCParticleSystemQuad *v128; // x26
void (__fastcall *setStartSizeVar)(cocos2d::CCParticleSystem *__hidden, float); // x24
float v130; // s0
cocos2d::CCParticleSystemQuad *v131; // x2
cocos2d::CCParticleSystemQuad *v132; // x0
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
cocos2d::CCParticleSystemQuad *v134; // x0
void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
cocos2d::CCParticleSystemQuad *v136; // x0
void (__fastcall *v137)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
cocos2d::CCParticleSystemQuad *v138; // x0
void (__fastcall *v139)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
bool v140; // w2
int v141; // w26
cocos2d::CCParticleSystemQuad *v142; // x24
void (__fastcall *v143)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
void (__fastcall *v144)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
cocos2d::CCParticleSystemQuad *v145; // x0
cocos2d::CCParticleSystemQuad_vtbl *v146; // x2
bool v147; // w2
cocos2d::CCParticleSystemQuad *v148; // x0
cocos2d::CCParticleSystemQuad_vtbl *v149; // x2
float v150; // s0
cocos2d::CCParticleSystemQuad *m_landParticles0; // x1
float y; // w2
cocos2d::CCParticleSystemQuad *v153; // x0
cocos2d::CCParticleSystemQuad_vtbl *v154; // x2
cocos2d::CCString *v155; // x0
char *v156; // x0
cocos2d::CCSprite *v157; // x0
cocos2d::CCSprite_vtbl *v158; // x2
cocos2d::CCNode *v159; // x0
cocos2d::CCNode_vtbl *v160; // x4
cocos2d::CCSprite *m_dashSpritesContainer; // x1
cocos2d::CCSprite *v162; // x0
cocos2d::CCSprite_vtbl *v163; // x2
cocos2d::CCSprite *m_dashFireSprite; // x22
void (__fastcall *v165)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCSprite *v166; // x22
void (__fastcall *v167)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCSprite *v168; // x0
cocos2d::CCSprite_vtbl *v169; // x2
cocos2d::CCString *v170; // x0
char *v171; // x0
cocos2d::CCSprite *v172; // x0
cocos2d::CCSprite *v173; // x3
GameManager *v174; // x0
GameManager *v175; // x0
GameManager *v176; // x0
bool GameVariable; // w0
float *m_start; // x3
int32x4_t *m_finish; // x1
int32x2_t v180; // d0
unsigned __int64 v181; // x2
char *p_m_fBrVertexMod; // x0
char *v183; // x0
char *v184; // x0
char *v185; // x0
unsigned int *v186; // x1
int v187; // w2
unsigned int *v188; // x1
int v189; // w2
unsigned int *v190; // x19
int v191; // w1
unsigned int *v192; // x1
int v193; // w2
unsigned int *v194; // x1
int v195; // w2
unsigned int *v196; // x1
int v197; // w2
unsigned int *p_m_fTextureTop; // x1
int m_fTextureTop_low; // w2
unsigned int *v200; // x1
int v201; // w2
int v203; // [xsp+A8h] [xbp+A8h]
cocos2d::CCParticleSystemQuad *setPosVar; // [xsp+A8h] [xbp+A8h]
cocos2d::CCSprite *v205; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCSprite *v206; // [xsp+C8h] [xbp+C8h] BYREF
const char *v207; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCSprite *v208; // [xsp+D8h] [xbp+D8h] BYREF
cocos2d::CCSprite *v209; // [xsp+E0h] [xbp+E0h] BYREF
cocos2d::CCSprite *v210; // [xsp+E8h] [xbp+E8h] BYREF
cocos2d::CCPoint v211; // [xsp+F0h] [xbp+F0h] BYREF
cocos2d::CCSprite *v212; // [xsp+F8h] [xbp+F8h] BYREF
int v213; // [xsp+100h] [xbp+100h]
float v214; // [xsp+104h] [xbp+104h]
cocos2d::CCPoint v215; // 0:kr00_8.8
cocos2d::CCPoint v216; // 0:kr08_8.8
cocos2d::CCPoint v217; // 0:kr10_8.8
cocos2d::CCPoint v218; // 0:kr18_8.8
cocos2d::CCPoint v219; // 0:kr20_8.8
cocos2d::CCPoint v220; // 0:kr28_8.8
cocos2d::CCPoint v221; // 0:kr30_8.8
v8 = a6;
if ( a2 <= 0 )
{
v9 = 1;
}
else if ( a2 > 485 )
{
v9 = 485;
}
else
{
v9 = a2;
}
if ( a3 <= 0 )
{
v10 = 1;
}
else if ( a3 > 169 )
{
v10 = 169;
}
else
{
v10 = a3;
}
v11 = GameManager::sharedState();
a1->m_iconRequestID = GameManager::getIconRequestID(v11);
v12 = GameManager::sharedState();
GameManager::loadIcon(v12, v9, 0, a1->m_iconRequestID);
v13 = GameManager::sharedState();
GameManager::loadIcon(v13, v10, 1, a1->m_iconRequestID);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"player_%02d_001.png",
(const char *)v9);
CString = (char *)cocos2d::CCString::getCString(v14);
sub_D153B8((int)&v205, CString);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"player_%02d_2_001.png",
(const char *)v9);
v17 = (char *)cocos2d::CCString::getCString(v16);
sub_D153B8((int)&v206, v17);
v18 = GameObject::init(a1, (const char *)v205);
if ( !v18 )
goto LABEL_10;
a1->m_bUnkBool2 = 0;
a1->m_bDontDraw = (unsigned __int8)&dword_0 + 1;
v22 = cocos2d::CCNode::create();
v23 = v22->__vftable;
a1->m_mainLayer = v22;
v23->setContentSize(v22, &stru_1242048);
a1->addChild(a1, a1->m_mainLayer);
sub_D1798C(&a1->m_currentRobotAnimation, "run", 3);
v24 = GameManager::sharedState();
a1->m_switchWaveTrailColor = GameManager::getGameVariable(v24, "0096");
v25 = GameManager::sharedState();
a1->m_practiceDeathEffect = GameManager::getGameVariable(v25, "0100");
v26 = GameManager::sharedState();
a1->m_gv0123 = GameManager::getGameVariable(v26, "0123");
v27 = GameStatsManager::sharedState();
a1->m_robotAnimation1Enabled = GameStatsManager::isItemEnabled(v27, GJItem, 18);
v28 = GameStatsManager::sharedState();
a1->m_robotAnimation2Enabled = GameStatsManager::isItemEnabled(v28, GJItem, 19);
v29 = GameStatsManager::sharedState();
a1->m_spiderAnimationEnabled = GameStatsManager::isItemEnabled(v29, GJItem, 20);
a1->m_maybeSavedPlayerFrame = v9;
a1->m_ghostType = 0;
a1->m_playerSpeed = 0.9;
v30 = rand();
a1->m_gameLayer = a4;
a1->m_parentLayer = a5;
a1->m_playEffects = v8;
a1->m_maybeCanRunIntoBlocks = !v8;
a1->m_playerSpeedAC = (float)((float)((float)v30 * 4.6566e-10) * 10.0) + 5.0;
v31 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)!v8);
a1->m_touchingRings = v31;
cocos2d::CCObject::retain(v31);
a1->setTextureRect(a1, &stru_1242038);
v32 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v205);
m_mainLayer = a1->m_mainLayer;
a1->m_iconSprite = v32;
m_mainLayer->addChild_0(m_mainLayer, v32, 1);
v34 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v206);
m_iconSprite = a1->m_iconSprite;
a1->m_iconSpriteSecondary = v34;
m_iconSprite->addChild_0(m_iconSprite, v34, -1);
m_iconSpriteSecondary = a1->m_iconSpriteSecondary;
setPosition = m_iconSpriteSecondary->setPosition;
v215 = cocos2d::CCNode::convertToNodeSpace(a1->m_iconSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))setPosition)(
m_iconSpriteSecondary,
&v212,
v215.x,
v215.y);
v38 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v206);
v39 = a1->m_iconSprite;
a1->m_iconSpriteWhitener = v38;
v39->addChild_0(v39, v38, 2);
m_iconSpriteWhitener = a1->m_iconSpriteWhitener;
v41 = m_iconSpriteWhitener->setPosition;
v216 = cocos2d::CCNode::convertToNodeSpace(a1->m_iconSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v41)(
m_iconSpriteWhitener,
&v212,
v216.x,
v216.y);
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"player_%02d_extra_001.png",
(const char *)v9);
v43 = (char *)cocos2d::CCString::getCString(v42);
sub_D153B8((int)&v207, v43);
PlayerObject::updatePlayerSpriteExtra((__int64)a1, &v207);
v44 = (char *)(v207 - 24);
if ( v207 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v200 = (unsigned int *)(v207 - 8);
do
v201 = __ldaxr(v200);
while ( __stlxr(v201 - 1, v200) );
}
else
{
v201 = *((_DWORD *)v207 - 2);
*((_DWORD *)v207 - 2) = v201 - 1;
}
if ( v201 <= 0 )
operator delete(v44);
}
v45 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ship_%02d_001.png",
(const char *)v10);
v46 = (char *)cocos2d::CCString::getCString(v45);
sub_D153B8((int)&v208, v46);
v47 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ship_%02d_2_001.png",
(const char *)v10);
v48 = (char *)cocos2d::CCString::getCString(v47);
sub_D153B8((int)&v209, v48);
v49 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v208);
v50 = a1->m_mainLayer;
a1->m_vehicleSprite = v49;
v50->addChild_0(v50, v49, 2);
a1->m_vehicleSprite->setVisible(a1->m_vehicleSprite, 0);
v51 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v209);
m_vehicleSprite = a1->m_vehicleSprite;
a1->m_vehicleSpriteSecondary = v51;
m_vehicleSprite->addChild_0(m_vehicleSprite, v51, -1);
m_vehicleSpriteSecondary = a1->m_vehicleSpriteSecondary;
v54 = m_vehicleSpriteSecondary->setPosition;
v217 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v54)(
m_vehicleSpriteSecondary,
&v212,
v217.x,
v217.y);
v55 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v209);
v56 = a1->m_vehicleSprite;
a1->m_birdVehicle = v55;
v56->addChild_0(v56, v55, -2);
m_birdVehicle = a1->m_birdVehicle;
v58 = m_birdVehicle->setPosition;
v218 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v58)(
m_birdVehicle,
&v212,
v218.x,
v218.y);
a1->m_birdVehicle->setVisible(a1->m_birdVehicle, 0);
v59 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v209);
v60 = a1->m_vehicleSprite;
a1->m_vehicleSpriteWhitener = v59;
v60->addChild_0(v60, v59, 1);
m_vehicleSpriteWhitener = a1->m_vehicleSpriteWhitener;
v62 = m_vehicleSpriteWhitener->setPosition;
v219 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v62)(
m_vehicleSpriteWhitener,
&v212,
v219.x,
v219.y);
v63 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ship_%02d_extra_001.png",
(const char *)v10);
v64 = (char *)cocos2d::CCString::getCString(v63);
sub_D153B8((int)&v211, v64);
PlayerObject::updateShipSpriteExtra((__int64)a1, (const char **)&v211);
v65 = (void *)(*(_QWORD *)&v211 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v211 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v192 = (unsigned int *)(*(_QWORD *)&v211 - 8LL);
do
v193 = __ldaxr(v192);
while ( __stlxr(v193 - 1, v192) );
}
else
{
v193 = *(_DWORD *)(*(_QWORD *)&v211 - 8LL);
*(_DWORD *)(*(_QWORD *)&v211 - 8LL) = v193 - 1;
}
if ( v193 <= 0 )
operator delete(v65);
}
v66 = GameManager::sharedState();
PlayerObject::createRobot(a1, v66->m_playerRobot.random - v66->m_playerRobot.seed);
v67 = PlayerFireBoostSprite::create();
v68 = a1->m_mainLayer;
a1->m_robotFire = v67;
v68->addChild_0(v68, v67, -1);
a1->m_robotFire->setVisible(a1->m_robotFire, 0);
v69 = GameManager::sharedState();
PlayerObject::createSpider(a1, v69->m_playerSpider.random - v69->m_playerSpider.seed);
v203 = (unsigned int)&dword_0 + 1;
for ( i = 0; ; ++i )
{
v71 = PlayerFireBoostSprite::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v71, -1);
if ( i )
v72 = 1060655596;
else
v72 = 1064682128;
v73 = v71->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
LODWORD(v71->m_size) = v72;
v73->setVisible(v71, 0);
if ( !i )
{
a1->m_swingFireMiddle = v71;
goto LABEL_21;
}
if ( (_DWORD)i != 1 )
break;
a1->m_swingFireBottom = v71;
LABEL_21:
++v203;
}
a1->m_swingFireTop = v71;
if ( v203 != 3 )
goto LABEL_21;
a1->m_swingFireMiddle->setRotation(a1->m_swingFireMiddle, 90.0);
m_swingFireMiddle = a1->m_swingFireMiddle;
v75 = m_swingFireMiddle->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v212, -14.0, 0.0);
v75(m_swingFireMiddle, (const cocos2d::CCPoint *)&v212);
a1->m_swingFireBottom->setRotation(a1->m_swingFireBottom, 45.0);
m_swingFireBottom = a1->m_swingFireBottom;
v77 = m_swingFireBottom->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v212, -9.5, -10.0);
v77(m_swingFireBottom, (const cocos2d::CCPoint *)&v212);
a1->m_swingFireTop->setRotation(a1->m_swingFireTop, 135.0);
m_swingFireTop = a1->m_swingFireTop;
v79 = m_swingFireTop->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v212, -9.5, 10.0);
v79(m_swingFireTop, (const cocos2d::CCPoint *)&v212);
PlayerObject::setYVelocity(a1, 0.0, 51);
a1->m_maybeIsBoosted = 0;
a1->m_isOnGround = 0;
a1->m_vehicleSize = 1.0;
a1->m_isOnGround2 = 0;
a1->m_isDead = 0;
a1->m_unkAngle1 = 30.0;
PlayerObject::updateTimeMod(a1, 0.9, 0);
a1->m_pendingCheckpoint = nullptr;
v80 = (GameObject *)cocos2d::CCNode::create();
a1->m_maybeLastGroundObject = v80;
cocos2d::CCObject::retain(v80);
v81 = cocos2d::CCDictionary::create();
a1->m_collisionLogTop = v81;
cocos2d::CCObject::retain(v81);
v82 = cocos2d::CCDictionary::create();
a1->m_collisionLogBottom = v82;
cocos2d::CCObject::retain(v82);
v83 = cocos2d::CCDictionary::create();
a1->m_collisionLogLeft = v83;
cocos2d::CCObject::retain(v83);
v84 = cocos2d::CCDictionary::create();
a1->m_collisionLogRight = v84;
cocos2d::CCObject::retain(v84);
v86 = (cocos2d::CCArray *)cocos2d::CCArray::create(v85);
a1->m_particleSystems = v86;
cocos2d::CCObject::retain(v86);
v87 = GJActionManager::create();
a1->m_actionManager = v87;
cocos2d::CCObject::retain(v87);
v89 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"dragEffect.plist",
nullptr,
v88);
v90 = v89->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_playerGroundParticles = v89;
v90->setPositionType(v89, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_playerGroundParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_playerGroundParticles);
a1->m_hasGroundParticles = 0;
v92 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"dashEffect.plist",
nullptr,
v91);
v93 = v92->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_dashParticles = v92;
v93->setPositionType(v92, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_dashParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_dashParticles);
v95 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"burstEffect.plist",
nullptr,
v94);
v96 = v95->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_ufoClickParticles = v95;
v96->setPositionType(v95, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_ufoClickParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_ufoClickParticles);
v98 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"burstEffect2.plist",
nullptr,
v97);
v99 = v98->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_robotBurstParticles = v98;
v99->setPositionType(v98, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_robotBurstParticles);
v101 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"dragEffect.plist",
nullptr,
v100);
v102 = v101->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_trailingParticles = v101;
v102->setPositionType(v101, kCCPositionTypeRelative);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_trailingParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_trailingParticles);
v103 = a1->m_trailingParticles->getLife(a1->m_trailingParticles);
m_trailingParticles = a1->m_trailingParticles;
a1->m_trailingParticleLife = v103;
setPosVar = (cocos2d::CCParticleSystemQuad *)m_trailingParticles->setPosVar;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v212, 0.0, 2.0);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, cocos2d::CCSprite **))setPosVar)(m_trailingParticles, &v212);
v106 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"dragEffect.plist",
nullptr,
v105);
v107 = v106->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_shipClickParticles = v106;
v107->setPositionType(v106, kCCPositionTypeRelative);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_shipClickParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles);
v108 = a1->m_trailingParticles;
setSpeed = v108->setSpeed;
v110 = v108->getSpeed(v108);
setSpeed(v108, v110 * 0.2);
v111 = a1->m_trailingParticles;
setSpeedVar = v111->setSpeedVar;
v113 = v111->getSpeedVar(v111);
setSpeedVar(v111, v113 * 0.2);
m_shipClickParticles = a1->m_shipClickParticles;
v115 = m_shipClickParticles->setPosVar;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v212, 0.0, 2.0);
v115(m_shipClickParticles, (const cocos2d::CCPoint *)&v212);
v116 = a1->m_shipClickParticles;
v117 = v116->setSpeed;
v118 = v116->getSpeed(v116);
v117(v116, v118 + v118);
v119 = a1->m_shipClickParticles;
v120 = v119->setSpeedVar;
v121 = v119->getSpeedVar(v119);
v120(v119, v121 + v121);
v122 = a1->m_shipClickParticles;
setAngleVar = v122->setAngleVar;
v124 = v122->getAngleVar(v122);
setAngleVar(v122, v124 + v124);
v125 = a1->m_shipClickParticles;
setStartSize = v125->setStartSize;
v127 = v125->getStartSize(v125);
setStartSize(v125, v127 * 1.5);
v128 = a1->m_shipClickParticles;
setStartSizeVar = v128->setStartSizeVar;
v130 = v128->getStartSizeVar(v128);
setStartSizeVar(v128, v130 * 1.5);
v131 = a1->m_trailingParticles;
a1->m_hasShipParticles = 0;
v132 = v131;
setStartColor = v131->setStartColor;
v212 = (cocos2d::CCSprite *)(COERCE_UNSIGNED_INT(1.0) | 0x3EC8C8C900000000LL);
v213 = 0;
v214 = 1.0;
setStartColor(v132, (const cocos2d::ccColor4F *)&v212);
v134 = a1->m_trailingParticles;
setEndColor = v134->setEndColor;
v212 = (cocos2d::CCSprite *)COERCE_UNSIGNED_INT(1.0);
v213 = 0;
v214 = 1.0;
setEndColor(v134, (const cocos2d::ccColor4F *)&v212);
v136 = a1->m_shipClickParticles;
v137 = v136->setStartColor;
v212 = (cocos2d::CCSprite *)(COERCE_UNSIGNED_INT(1.0) | 0x3F3EBEBF00000000LL);
v213 = 0;
v214 = 1.0;
v137(v136, (const cocos2d::ccColor4F *)&v212);
v138 = a1->m_shipClickParticles;
v139 = v138->setEndColor;
v212 = (cocos2d::CCSprite *)COERCE_UNSIGNED_INT(1.0);
v213 = 0;
v214 = 1.0;
v139(v138, (const cocos2d::ccColor4F *)&v212);
v141 = 1;
while ( 2 )
{
v142 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"swingBurstEffect.plist",
nullptr,
v140);
v142->setPositionType(v142, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, v142);
cocos2d::CCParticleSystem::stopSystem(v142);
v143 = v142->setStartColor;
v212 = (cocos2d::CCSprite *)(COERCE_UNSIGNED_INT(1.0) | 0x3EC8C8C900000000LL);
v213 = 0;
v214 = 1.0;
v143(v142, (const cocos2d::ccColor4F *)&v212);
v144 = v142->setEndColor;
v212 = (cocos2d::CCSprite *)COERCE_UNSIGNED_INT(1.0);
v213 = 0;
v214 = 1.0;
v144(v142, (const cocos2d::ccColor4F *)&v212);
if ( v141 == 1 )
{
a1->m_swingBurstParticles1 = v142;
goto LABEL_38;
}
a1->m_swingBurstParticles2 = v142;
if ( v141 != 2 )
{
LABEL_38:
++v141;
continue;
}
break;
}
v145 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"shipDragEffect.plist",
nullptr,
v140);
v146 = v145->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_vehicleGroundParticles = v145;
v146->setPositionType(v145, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_vehicleGroundParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles);
v148 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"landEffect.plist",
nullptr,
v147);
v149 = v148->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_landParticles0 = v148;
v149->setPositionType(v148, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_landParticles0);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles0);
v150 = a1->m_landParticles0->getAngle(a1->m_landParticles0);
m_landParticles0 = a1->m_landParticles0;
a1->m_landParticlesAngle = v150;
y = m_landParticles0->getGravity(m_landParticles0)->y;
a1->m_landParticleRelatedY = y;
v153 = (cocos2d::CCParticleSystemQuad *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"landEffect.plist",
nullptr,
SLOBYTE(y));
v154 = v153->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_landParticles1 = v153;
v154->setPositionType(v153, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_landParticles1);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles1);
PlayerObject::setupStreak(a1);
v155 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"player_%02d_glow_001.png",
(const char *)v9);
v156 = (char *)cocos2d::CCString::getCString(v155);
sub_D153B8((int)&v210, v156);
v157 = cocos2d::CCSprite::create();
v158 = v157->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_dashSpritesContainer = v157;
v158->setTextureRect(v157, &stru_1242038);
v159 = a1->m_mainLayer;
v160 = v159->__vftable;
m_dashSpritesContainer = a1->m_dashSpritesContainer;
m_dashSpritesContainer->m_bDontDraw = 1;
v160->addChild_0(v159, m_dashSpritesContainer, -1);
v162 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_001.png");
v163 = v162->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_dashFireSprite = v162;
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v163->setBlendFunc)(v162, 0x100000302LL);
a1->m_dashSpritesContainer->addChild(a1->m_dashSpritesContainer, a1->m_dashFireSprite);
m_dashFireSprite = a1->m_dashFireSprite;
v165 = m_dashFireSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v211, 0.0, 0.0);
v220 = cocos2d::CCNode::convertToNodeSpace(a1, &v211);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v165)(
m_dashFireSprite,
&v212,
v220.x,
v220.y);
a1->m_dashFireSprite->setVisible(a1->m_dashFireSprite, 0);
v166 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_outline_001.png");
a1->m_dashFireSprite->addChild_0(a1->m_dashFireSprite, v166, 1);
v167 = v166->setPosition;
v221 = cocos2d::CCNode::convertToNodeSpace(a1->m_dashFireSprite, &stru_1242030);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite **, float, float))v167)(v166, &v212, v221.x, v221.y);
v166->setOpacity(v166, 4294967190LL);
v168 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v210);
v169 = v168->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_iconGlow = v168;
v169->setVisible(v168, 0);
a1->m_dashSpritesContainer->addChild_0(a1->m_dashSpritesContainer, a1->m_iconGlow, 2);
v170 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ship_%02d_glow_001.png",
(const char *)v10);
v171 = (char *)cocos2d::CCString::getCString(v170);
sub_D153B8((int)&v212, v171);
v172 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v212);
v173 = a1->m_dashSpritesContainer;
a1->m_vehicleGlow = v172;
v173->addChild_0(v173, v172, -3);
a1->m_vehicleGlow->setVisible(a1->m_vehicleGlow, 0);
a1->m_width = 30.0;
a1->m_height = 30.0;
a1->m_unkAngle1 = 30.0;
v174 = GameManager::sharedState();
a1->m_defaultMiniIcon = GameManager::getGameVariable(v174, "0060");
v175 = GameManager::sharedState();
a1->m_swapColors = GameManager::getGameVariable(v175, "0061");
v176 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v176, "0062");
m_start = a1->m_playerFollowFloats.m_start;
m_finish = (int32x4_t *)a1->m_playerFollowFloats.m_finish;
v180.n64_u32[0] = 0;
a1->m_switchDashFireColor = GameVariable;
v181 = ((char *)m_finish - (char *)m_start) >> 2;
v211.x = 0.0;
if ( v181 <= 0xC7 )
{
std::vector::_M_fill_insert(
(__int64)&a1->m_playerFollowFloats,
m_finish,
200 - v181,
(unsigned __int32 *)&v211,
v180);
}
else if ( v181 != 200 )
{
a1->m_playerFollowFloats.m_finish = m_start + 200;
}
PlayerObject::updateCheckpointMode(a1, 0);
p_m_fBrVertexMod = (char *)&v212[-1].m_fBrVertexMod;
if ( (__int64 *)&v212[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_fTextureTop = (unsigned int *)&v212[-1].m_fTextureTop;
do
m_fTextureTop_low = __ldaxr(p_m_fTextureTop);
while ( __stlxr(m_fTextureTop_low - 1, p_m_fTextureTop) );
}
else
{
m_fTextureTop_low = LODWORD(v212[-1].m_fTextureTop);
LODWORD(v212[-1].m_fTextureTop) = m_fTextureTop_low - 1;
}
if ( m_fTextureTop_low <= 0 )
operator delete(p_m_fBrVertexMod);
}
v183 = (char *)&v210[-1].m_fBrVertexMod;
if ( (__int64 *)&v210[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
v194 = (unsigned int *)&v210[-1].m_fTextureTop;
do
v195 = __ldaxr(v194);
while ( __stlxr(v195 - 1, v194) );
}
else
{
v195 = LODWORD(v210[-1].m_fTextureTop);
LODWORD(v210[-1].m_fTextureTop) = v195 - 1;
}
if ( v195 <= 0 )
operator delete(v183);
}
v184 = (char *)&v209[-1].m_fBrVertexMod;
if ( (__int64 *)&v209[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
v196 = (unsigned int *)&v209[-1].m_fTextureTop;
do
v197 = __ldaxr(v196);
while ( __stlxr(v197 - 1, v196) );
}
else
{
v197 = LODWORD(v209[-1].m_fTextureTop);
LODWORD(v209[-1].m_fTextureTop) = v197 - 1;
}
if ( v197 <= 0 )
operator delete(v184);
}
v185 = (char *)&v208[-1].m_fBrVertexMod;
if ( (__int64 *)&v208[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
v186 = (unsigned int *)&v208[-1].m_fTextureTop;
do
v187 = __ldaxr(v186);
while ( __stlxr(v187 - 1, v186) );
}
else
{
v187 = LODWORD(v208[-1].m_fTextureTop);
LODWORD(v208[-1].m_fTextureTop) = v187 - 1;
}
if ( v187 <= 0 )
operator delete(v185);
}
LABEL_10:
v19 = (char *)&v206[-1].m_fBrVertexMod;
if ( (__int64 *)&v206[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
v188 = (unsigned int *)&v206[-1].m_fTextureTop;
do
v189 = __ldaxr(v188);
while ( __stlxr(v189 - 1, v188) );
}
else
{
v189 = LODWORD(v206[-1].m_fTextureTop);
LODWORD(v206[-1].m_fTextureTop) = v189 - 1;
}
if ( v189 <= 0 )
operator delete(v19);
}
v20 = (char *)&v205[-1].m_fBrVertexMod;
if ( (__int64 *)&v205[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
v190 = (unsigned int *)&v205[-1].m_fTextureTop;
do
v191 = __ldaxr(v190);
while ( __stlxr(v191 - 1, v190) );
}
else
{
v191 = LODWORD(v205[-1].m_fTextureTop);
LODWORD(v205[-1].m_fTextureTop) = v191 - 1;
}
if ( v191 <= 0 )
operator delete(v20);
}
return v18;
}