//
// PlayerObject::init from 0x140386770 to 0x140387ee8 (6008 bytes)
//
// 2 xrefs:
// > PlayerObject::create @ 0x14038672e
// > ??> @ 0x1406d5f3c
//
// 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
//
// Hidden C++ exception states: #wind=24
bool PlayerObject::init(PlayerObject *a1, int a2, int a3, GJBaseGameLayer *a4, cocos2d::CCLayer *a5, bool a6)
{
int v8; // eax
int v9; // r12d
int v10; // eax
int v11; // r13d
GameManager *v12; // rcx
int m_iconRequestID; // r9d
GameManager *v14; // rcx
cocos2d::CCString *v15; // rax
const char *CString; // rax
size_t v17; // r14
size_t v18; // r8
cocos2d::CCString *v19; // rax
const char *v20; // rax
size_t v21; // r8
const char *v22; // rdx
bool v23; // bl
__int64 v24; // rdx
__int64 v25; // rcx
cocos2d::CCNode *v26; // rax
GameManager *v27; // rcx
GameManager *v28; // rcx
GameManager *v29; // rcx
GameStatsManager *v30; // rcx
__int64 v31; // rbx
GameStatsManager *v32; // rcx
bool v33; // bl
cocos2d::CCString *v34; // rax
__int64 v35; // rbx
GameStatsManager *v36; // rcx
bool v37; // bl
cocos2d::CCString *v38; // rax
__int64 v39; // rbx
__int64 v40; // rcx
bool v41; // bl
cocos2d::CCString *v42; // rax
__int64 v43; // rcx
cocos2d::CCArray *v44; // rax
const char *v45; // rcx
cocos2d::CCSprite *v46; // rax
const char *v47; // rcx
cocos2d::CCSprite *v48; // rax
cocos2d::CCSprite_vtbl *v49; // rbx
struct cocos2d::CCPoint v50; // rax
const char *v51; // rcx
cocos2d::CCSprite *v52; // rax
cocos2d::CCSprite_vtbl *v53; // rbx
struct cocos2d::CCPoint v54; // rax
cocos2d::CCString *v55; // rax
const char *v56; // rax
size_t v57; // r8
cocos2d::CCString *v58; // rax
const char *v59; // rax
size_t v60; // r8
cocos2d::CCString *v61; // rax
const char *v62; // rax
size_t v63; // r8
const char *v64; // rcx
cocos2d::CCSprite *v65; // rax
const char *v66; // rcx
cocos2d::CCSprite *v67; // rax
cocos2d::CCSprite_vtbl *v68; // rbx
struct cocos2d::CCPoint v69; // rax
const char *v70; // rcx
cocos2d::CCSprite *v71; // rax
cocos2d::CCSprite_vtbl *v72; // rbx
struct cocos2d::CCPoint v73; // rax
const char *v74; // rcx
cocos2d::CCSprite *v75; // rax
cocos2d::CCSprite_vtbl *v76; // rbx
struct cocos2d::CCPoint v77; // rax
cocos2d::CCString *v78; // rax
const char *v79; // rax
size_t v80; // r8
__int64 v81; // rax
PlayerFireBoostSprite *v82; // rax
__int64 v83; // rax
int i; // ebx
PlayerFireBoostSprite *v85; // rdi
float v86; // xmm0_4
PlayerFireBoostSprite *v87; // rdi
float v88; // xmm0_4
PlayerFireBoostSprite *v89; // rdi
float v90; // xmm0_4
float v91; // xmm0_4
PlayerFireBoostSprite_vtbl *v92; // rbx
const cocos2d::CCPoint *v93; // rax
float v94; // xmm0_4
PlayerFireBoostSprite_vtbl *v95; // rbx
const cocos2d::CCPoint *v96; // rax
float v97; // xmm0_4
PlayerFireBoostSprite_vtbl *v98; // rbx
const cocos2d::CCPoint *v99; // rax
__int64 v100; // rdx
__int64 v101; // rcx
GameObject *v102; // rax
__int64 v103; // rcx
cocos2d::CCDictionary *v104; // rax
__int64 v105; // rcx
cocos2d::CCDictionary *v106; // rax
__int64 v107; // rcx
cocos2d::CCDictionary *v108; // rax
__int64 v109; // rcx
cocos2d::CCDictionary *v110; // rax
__int64 v111; // rcx
cocos2d::CCArray *v112; // rax
GJActionManager *v113; // rbx
cocos2d::CCParticleSystemQuad *v114; // rax
cocos2d::CCParticleSystemQuad *v115; // rax
cocos2d::CCParticleSystemQuad *v116; // rax
cocos2d::CCParticleSystemQuad *v117; // rax
cocos2d::CCParticleSystemQuad *v118; // rax
float v119; // xmm0_4
cocos2d::CCParticleSystemQuad_vtbl *v120; // rbx
const cocos2d::CCPoint *v121; // rax
cocos2d::CCParticleSystemQuad *v122; // rax
cocos2d::CCParticleSystemQuad *m_trailingParticles; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v124; // rbx
cocos2d::CCParticleSystemQuad *v125; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v126; // rbx
float v127; // xmm0_4
cocos2d::CCParticleSystemQuad_vtbl *v128; // rbx
const cocos2d::CCPoint *v129; // rax
cocos2d::CCParticleSystemQuad *m_shipClickParticles; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v131; // rbx
cocos2d::CCParticleSystemQuad *v132; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v133; // rbx
cocos2d::CCParticleSystemQuad *v134; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v135; // rbx
cocos2d::CCParticleSystemQuad *v136; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v137; // rbx
cocos2d::CCParticleSystemQuad *v138; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v139; // rbx
int j; // edi
struct cocos2d::CCParticleSystemQuad *v141; // rbx
cocos2d::CCParticleSystemQuad *v142; // rax
cocos2d::CCParticleSystemQuad *v143; // rax
cocos2d::CCParticleSystemQuad *v144; // rax
cocos2d::CCString *v145; // rax
const char *v146; // rax
size_t v147; // r8
cocos2d::CCSprite *v148; // rax
struct cocos2d::CCSprite *v149; // rax
float v150; // xmm0_4
cocos2d::CCSprite_vtbl *v151; // rbx
struct cocos2d::CCPoint v152; // rax
struct cocos2d::CCSprite *v153; // rdi
cocos2d::CCSprite_vtbl *v154; // rbx
struct cocos2d::CCPoint v155; // rax
__int64 v156; // rdx
const char *v157; // rcx
cocos2d::CCSprite *v158; // rax
cocos2d::CCString *v159; // rax
const char *v160; // rax
const char *v161; // rcx
cocos2d::CCSprite *v162; // rax
GameManager *v163; // rcx
GameManager *v164; // rcx
GameManager *v165; // rcx
std::_Vector_val>::pointer Myfirst; // r8
unsigned __int64 v167; // rcx
std::_Simple_types::value_type *v168; // rax
__int64 v170; // [rsp+20h] [rbp-E0h] BYREF
__int128 v171; // [rsp+28h] [rbp-D8h] BYREF
__int64 v172; // [rsp+38h] [rbp-C8h]
__int64 v173; // [rsp+40h] [rbp-C0h]
__int128 v174; // [rsp+48h] [rbp-B8h] BYREF
__int64 v175; // [rsp+58h] [rbp-A8h]
unsigned __int64 v176; // [rsp+60h] [rbp-A0h]
__int128 v177; // [rsp+68h] [rbp-98h] BYREF
__int64 v178; // [rsp+78h] [rbp-88h]
unsigned __int64 v179; // [rsp+80h] [rbp-80h]
__int128 v180; // [rsp+88h] [rbp-78h] BYREF
__int64 v181; // [rsp+98h] [rbp-68h]
unsigned __int64 v182; // [rsp+A0h] [rbp-60h]
__int128 v183; // [rsp+A8h] [rbp-58h] BYREF
__int64 v184; // [rsp+B8h] [rbp-48h]
unsigned __int64 v185; // [rsp+C0h] [rbp-40h]
__int128 v186; // [rsp+C8h] [rbp-38h] BYREF
__int64 v187; // [rsp+D8h] [rbp-28h]
unsigned __int64 v188; // [rsp+E0h] [rbp-20h]
__int128 v189; // [rsp+E8h] [rbp-18h] BYREF
__int64 v190; // [rsp+F8h] [rbp-8h]
unsigned __int64 v191; // [rsp+100h] [rbp+0h]
_QWORD v192[4]; // [rsp+108h] [rbp+8h] BYREF
v8 = 485;
if ( a2 < 485 )
v8 = a2;
v9 = 1;
if ( v8 > 1 )
v9 = v8;
v10 = 169;
if ( a3 < 169 )
v10 = a3;
v11 = 1;
if ( v10 > 1 )
v11 = v10;
v12 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v12 = (GameManager *)qword_1406C2ED8;
}
m_iconRequestID = v12->m_iconRequestID;
v12->m_iconRequestID = m_iconRequestID + 1;
a1->m_iconRequestID = m_iconRequestID;
GameManager::loadIcon(v12, v9, 0, m_iconRequestID);
v14 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v14 = (GameManager *)qword_1406C2ED8;
}
GameManager::loadIcon(v14, v11, 1, a1->m_iconRequestID);
v15 = cocos2d::CCString::createWithFormat("player_%02d_001.png", v9);
CString = cocos2d::CCString::getCString(v15);
v180 = 0;
v181 = 0;
v182 = 0;
v17 = -1;
v18 = -1;
do
++v18;
while ( CString[v18] );
sub_14003A930(&v180, CString, v18);
v19 = cocos2d::CCString::createWithFormat("player_%02d_2_001.png", v9);
v20 = cocos2d::CCString::getCString(v19);
v177 = 0;
v178 = 0;
v179 = 0;
v21 = -1;
do
++v21;
while ( v20[v21] );
sub_14003A930(&v177, v20, v21);
v22 = (const char *)&v180;
if ( v182 > 0xF )
v22 = (const char *)v180;
a1->m_eObjType = GameObjectObjectType;
if ( cocos2d::CCSprite::initWithSpriteFrameName(a1, v22) )
{
GameObject::commonSetup(a1);
a1->m_bUnkBool2 = 0;
a1->m_bDontDraw = 1;
v26 = (cocos2d::CCNode *)cocos2d::CCNode::create(v25, v24);
a1->m_mainLayer = v26;
v26->setContentSize(v26, &stru_1406C2468);
a1->addChild_1(a1, a1->m_mainLayer);
sub_14003CCE0((void **)&a1->m_currentRobotAnimation, "run", 3u);
v27 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v27 = (GameManager *)qword_1406C2ED8;
}
a1->m_switchWaveTrailColor = GameManager::getGameVariable(v27, "0096");
v28 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v28 = (GameManager *)qword_1406C2ED8;
}
a1->m_practiceDeathEffect = GameManager::getGameVariable(v28, "0100");
v29 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v29 = (GameManager *)qword_1406C2ED8;
}
a1->m_gv0123 = GameManager::getGameVariable(v29, "0123");
v31 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v170 = (__int64)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v31 = qword_1406C2EE8;
}
if ( GameStatsManager::isItemUnlocked(v30, GJItem, 18) )
{
GameStatsManager::getItemKey((__int64)v32, &v171, 0x12u, 0xCu);
v34 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v31 + 888), &v171);
v33 = cocos2d::CCString::boolValue(v34);
sub_14003A830((__int64)&v171);
}
else
{
v33 = 0;
}
a1->m_robotAnimation1Enabled = v33;
v35 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v170 = (__int64)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v35 = qword_1406C2EE8;
}
if ( GameStatsManager::isItemUnlocked(v32, GJItem, 19) )
{
GameStatsManager::getItemKey((__int64)v36, v192, 0x13u, 0xCu);
v38 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v35 + 888), v192);
v37 = cocos2d::CCString::boolValue(v38);
sub_14003A830((__int64)v192);
}
else
{
v37 = 0;
}
a1->m_robotAnimation2Enabled = v37;
v39 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v170 = (__int64)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v39 = qword_1406C2EE8;
}
if ( GameStatsManager::isItemUnlocked(v36, GJItem, 20) )
{
GameStatsManager::getItemKey(v40, &v171, 0x14u, 0xCu);
v42 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v39 + 888), &v171);
v41 = cocos2d::CCString::boolValue(v42);
sub_14003A830((__int64)&v171);
}
else
{
v41 = 0;
}
a1->m_spiderAnimationEnabled = v41;
a1->m_maybeSavedPlayerFrame = v9;
a1->m_ghostType = 0;
a1->m_playerSpeed = 0.89999998;
a1->m_playerSpeedAC = (float)((float)((float)rand() / 32767.0) * 10.0) + 5.0;
a1->m_gameLayer = a4;
a1->m_parentLayer = a5;
a1->m_playEffects = a6;
a1->m_maybeCanRunIntoBlocks = !a6;
v44 = (cocos2d::CCArray *)cocos2d::CCArray::create(v43);
a1->m_touchingRings = v44;
cocos2d::CCObject::retain(v44);
a1->setTextureRect_0(a1, &stru_1406C2458);
v45 = (const char *)&v180;
if ( v182 > 0xF )
v45 = (const char *)v180;
v46 = cocos2d::CCSprite::createWithSpriteFrameName(v45);
a1->m_iconSprite = v46;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v46, 1);
v47 = (const char *)&v177;
if ( v179 > 0xF )
v47 = (const char *)v177;
v48 = cocos2d::CCSprite::createWithSpriteFrameName(v47);
a1->m_iconSpriteSecondary = v48;
a1->m_iconSprite->addChild_0(a1->m_iconSprite, v48, -1);
v49 = a1->m_iconSpriteSecondary->__vftable;
v50 = cocos2d::CCNode::convertToNodeSpace(a1->m_iconSprite, (const struct cocos2d::CCPoint *)&v170);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v49->setPosition_0)(
a1->m_iconSpriteSecondary,
v50);
v51 = (const char *)&v177;
if ( v179 > 0xF )
v51 = (const char *)v177;
v52 = cocos2d::CCSprite::createWithSpriteFrameName(v51);
a1->m_iconSpriteWhitener = v52;
a1->m_iconSprite->addChild_0(a1->m_iconSprite, v52, 2);
v53 = a1->m_iconSpriteWhitener->__vftable;
v54 = cocos2d::CCNode::convertToNodeSpace(a1->m_iconSprite, (const struct cocos2d::CCPoint *)&v170);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v53->setPosition_0)(
a1->m_iconSpriteWhitener,
v54);
v55 = cocos2d::CCString::createWithFormat("player_%02d_extra_001.png", v9);
v56 = cocos2d::CCString::getCString(v55);
v171 = 0;
v172 = 0;
v173 = 0;
v57 = -1;
do
++v57;
while ( v56[v57] );
sub_14003A930(&v171, v56, v57);
PlayerObject::updatePlayerSpriteExtra(a1, &v171);
v58 = cocos2d::CCString::createWithFormat("ship_%02d_001.png", v11);
v59 = cocos2d::CCString::getCString(v58);
v189 = 0;
v190 = 0;
v191 = 0;
v60 = -1;
do
++v60;
while ( v59[v60] );
sub_14003A930(&v189, v59, v60);
v61 = cocos2d::CCString::createWithFormat("ship_%02d_2_001.png", v11);
v62 = cocos2d::CCString::getCString(v61);
v174 = 0;
v175 = 0;
v176 = 0;
v63 = -1;
do
++v63;
while ( v62[v63] );
sub_14003A930(&v174, v62, v63);
v64 = (const char *)&v189;
if ( v191 > 0xF )
v64 = (const char *)v189;
v65 = cocos2d::CCSprite::createWithSpriteFrameName(v64);
a1->m_vehicleSprite = v65;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v65, 2);
a1->m_vehicleSprite->setVisible(a1->m_vehicleSprite, 0);
v66 = (const char *)&v174;
if ( v176 > 0xF )
v66 = (const char *)v174;
v67 = cocos2d::CCSprite::createWithSpriteFrameName(v66);
a1->m_vehicleSpriteSecondary = v67;
a1->m_vehicleSprite->addChild_0(a1->m_vehicleSprite, v67, -1);
v68 = a1->m_vehicleSpriteSecondary->__vftable;
v69 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, (const struct cocos2d::CCPoint *)&v170);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v68->setPosition_0)(
a1->m_vehicleSpriteSecondary,
v69);
v70 = (const char *)&v174;
if ( v176 > 0xF )
v70 = (const char *)v174;
v71 = cocos2d::CCSprite::createWithSpriteFrameName(v70);
a1->m_birdVehicle = v71;
a1->m_vehicleSprite->addChild_0(a1->m_vehicleSprite, v71, -2);
v72 = a1->m_birdVehicle->__vftable;
v73 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, (const struct cocos2d::CCPoint *)&v170);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v72->setPosition_0)(a1->m_birdVehicle, v73);
a1->m_birdVehicle->setVisible(a1->m_birdVehicle, 0);
v74 = (const char *)&v174;
if ( v176 > 0xF )
v74 = (const char *)v174;
v75 = cocos2d::CCSprite::createWithSpriteFrameName(v74);
a1->m_vehicleSpriteWhitener = v75;
a1->m_vehicleSprite->addChild_0(a1->m_vehicleSprite, v75, 1);
v76 = a1->m_vehicleSpriteWhitener->__vftable;
v77 = cocos2d::CCNode::convertToNodeSpace(a1->m_vehicleSprite, (const struct cocos2d::CCPoint *)&v170);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v76->setPosition_0)(
a1->m_vehicleSpriteWhitener,
v77);
v78 = cocos2d::CCString::createWithFormat("ship_%02d_extra_001.png", v11);
v79 = cocos2d::CCString::getCString(v78);
v171 = 0;
v172 = 0;
v173 = 0;
v80 = -1;
do
++v80;
while ( v79[v80] );
sub_14003A930(&v171, v79, v80);
PlayerObject::updateShipSpriteExtra(a1, &v171);
v81 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v81 = qword_1406C2ED8;
}
PlayerObject::createRobot(a1, *(_DWORD *)(v81 + 768) - *(_DWORD *)(v81 + 772));
v82 = PlayerFireBoostSprite::create();
a1->m_robotFire = v82;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v82, -1);
a1->m_robotFire->setVisible(a1->m_robotFire, 0);
v83 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v170 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v170);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v83 = qword_1406C2ED8;
}
PlayerObject::createSpider(a1, *(_DWORD *)(v83 + 780) - *(_DWORD *)(v83 + 784));
for ( i = 0; i < 3; i += 3 )
{
v85 = PlayerFireBoostSprite::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v85, -1);
if ( i )
v86 = 0.60000002;
else
v86 = 0.80000001;
v85->m_size = v86 * 1.2;
v85->setVisible(v85, 0);
if ( i )
{
if ( i == 1 )
a1->m_swingFireBottom = v85;
else
a1->m_swingFireTop = v85;
}
else
{
a1->m_swingFireMiddle = v85;
}
v87 = PlayerFireBoostSprite::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v87, -1);
if ( i == -1 )
v88 = 0.80000001;
else
v88 = 0.60000002;
v87->m_size = v88 * 1.2;
v87->setVisible(v87, 0);
if ( i == -1 )
{
a1->m_swingFireMiddle = v87;
}
else if ( i )
{
a1->m_swingFireTop = v87;
}
else
{
a1->m_swingFireBottom = v87;
}
v89 = PlayerFireBoostSprite::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v89, -1);
if ( i == -2 )
v90 = 0.80000001;
else
v90 = 0.60000002;
v89->m_size = v90 * 1.2;
v89->setVisible(v89, 0);
if ( i == -2 )
{
a1->m_swingFireMiddle = v89;
}
else if ( i == -1 )
{
a1->m_swingFireBottom = v89;
}
else
{
a1->m_swingFireTop = v89;
}
}
v91 = ((float (__fastcall *)(PlayerFireBoostSprite *))a1->m_swingFireMiddle->setRotation)(a1->m_swingFireMiddle);
v92 = a1->m_swingFireMiddle->__vftable;
cocos2d::CCPoint::CCPoint(v91, -14.0);
v92->setPosition_0(a1->m_swingFireMiddle, v93);
v94 = ((float (__fastcall *)(PlayerFireBoostSprite *))a1->m_swingFireBottom->setRotation)(a1->m_swingFireBottom);
v95 = a1->m_swingFireBottom->__vftable;
cocos2d::CCPoint::CCPoint(v94, -9.5);
v95->setPosition_0(a1->m_swingFireBottom, v96);
v97 = ((float (__fastcall *)(PlayerFireBoostSprite *))a1->m_swingFireTop->setRotation)(a1->m_swingFireTop);
v98 = a1->m_swingFireTop->__vftable;
cocos2d::CCPoint::CCPoint(v97, -9.5);
v98->setPosition_0(a1->m_swingFireTop, v99);
a1->m_yVelocity = 0.0;
a1->m_maybeIsBoosted = 0;
*(_WORD *)&a1->m_isDead = 0;
a1->m_isOnGround2 = 0;
a1->m_vehicleSize = 1.0;
a1->m_unkAngle1 = 30.0;
PlayerObject::updateTimeMod(a1, 0.89999998, 0);
a1->m_pendingCheckpoint = nullptr;
v102 = (GameObject *)cocos2d::CCNode::create(v101, v100);
a1->m_maybeLastGroundObject = v102;
cocos2d::CCObject::retain(v102);
v104 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v103);
a1->m_collisionLogTop = v104;
cocos2d::CCObject::retain(v104);
v106 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v105);
a1->m_collisionLogBottom = v106;
cocos2d::CCObject::retain(v106);
v108 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v107);
a1->m_collisionLogLeft = v108;
cocos2d::CCObject::retain(v108);
v110 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v109);
a1->m_collisionLogRight = v110;
cocos2d::CCObject::retain(v110);
v112 = (cocos2d::CCArray *)cocos2d::CCArray::create(v111);
a1->m_particleSystems = v112;
cocos2d::CCObject::retain(v112);
v113 = (GJActionManager *)operator new(0x148u);
v170 = (__int64)v113;
cocos2d::CCNode::CCNode(v113);
v113->__vftable = (GJActionManager_vtbl *)&GJActionManager::`vftable';
v113->m_internalActions = nullptr;
if ( GJAccountManager::init(v113) )
{
cocos2d::CCObject::autorelease(v113);
}
else
{
((void (__fastcall *)(GJActionManager *, __int64))v113->~GJActionManager)(v113, 1);
v113 = nullptr;
}
a1->m_actionManager = v113;
cocos2d::CCObject::retain(v113);
v114 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_playerGroundParticles = v114;
v114->setPositionType(v114, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_playerGroundParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_playerGroundParticles);
a1->m_hasGroundParticles = 0;
v115 = cocos2d::CCParticleSystemQuad::create("dashEffect.plist", 0);
a1->m_dashParticles = v115;
v115->setPositionType(v115, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_dashParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_dashParticles);
v116 = cocos2d::CCParticleSystemQuad::create("burstEffect.plist", 0);
a1->m_ufoClickParticles = v116;
v116->setPositionType(v116, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_ufoClickParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_ufoClickParticles);
v117 = cocos2d::CCParticleSystemQuad::create("burstEffect2.plist", 0);
a1->m_robotBurstParticles = v117;
v117->setPositionType(v117, kCCPositionTypeRelative);
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_robotBurstParticles);
v118 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_trailingParticles = v118;
v118->setPositionType(v118, kCCPositionTypeRelative);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_trailingParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_trailingParticles);
v119 = a1->m_trailingParticles->getLife(a1->m_trailingParticles);
a1->m_trailingParticleLife = v119;
v120 = a1->m_trailingParticles->__vftable;
cocos2d::CCPoint::CCPoint(v119, 0.0);
v120->setPosVar(a1->m_trailingParticles, v121);
v122 = cocos2d::CCParticleSystemQuad::create("dragEffect.plist", 0);
a1->m_shipClickParticles = v122;
v122->setPositionType(v122, kCCPositionTypeRelative);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_shipClickParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles);
m_trailingParticles = a1->m_trailingParticles;
v124 = m_trailingParticles->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_trailingParticles->getSpeed(m_trailingParticles);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v124->setSpeed)(a1->m_trailingParticles);
v125 = a1->m_trailingParticles;
v126 = v125->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v125->getSpeedVar(v125);
v127 = ((float (__fastcall *)(cocos2d::CCParticleSystemQuad *))v126->setSpeedVar)(a1->m_trailingParticles);
v128 = a1->m_shipClickParticles->__vftable;
cocos2d::CCPoint::CCPoint(v127, 0.0);
v128->setPosVar(a1->m_shipClickParticles, v129);
m_shipClickParticles = a1->m_shipClickParticles;
v131 = m_shipClickParticles->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_shipClickParticles->getSpeed(m_shipClickParticles);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v131->setSpeed)(a1->m_shipClickParticles);
v132 = a1->m_shipClickParticles;
v133 = v132->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v132->getSpeedVar(v132);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v133->setSpeedVar)(a1->m_shipClickParticles);
v134 = a1->m_shipClickParticles;
v135 = v134->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v134->getAngleVar(v134);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v135->setAngleVar)(a1->m_shipClickParticles);
v136 = a1->m_shipClickParticles;
v137 = v136->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v136->getStartSize(v136);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v137->setStartSize)(a1->m_shipClickParticles);
v138 = a1->m_shipClickParticles;
v139 = v138->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v138->getStartSizeVar(v138);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))v139->setStartSizeVar)(a1->m_shipClickParticles);
a1->m_hasShipParticles = 0;
v171 = xmmword_140624100;
a1->m_trailingParticles->setStartColor(a1->m_trailingParticles, (const cocos2d::ccColor4F *)&v171);
v171 = xmmword_1406240D0;
a1->m_trailingParticles->setEndColor(a1->m_trailingParticles, (const cocos2d::ccColor4F *)&v171);
v171 = xmmword_140624130;
a1->m_shipClickParticles->setStartColor(a1->m_shipClickParticles, (const cocos2d::ccColor4F *)&v171);
v171 = xmmword_1406240D0;
a1->m_shipClickParticles->setEndColor(a1->m_shipClickParticles, (const cocos2d::ccColor4F *)&v171);
for ( j = 0; j < 2; ++j )
{
while ( 1 )
{
v141 = cocos2d::CCParticleSystemQuad::create("swingBurstEffect.plist", 0);
v141->setPositionType(v141, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, v141);
cocos2d::CCParticleSystem::stopSystem(v141);
v171 = xmmword_140624100;
v141->setStartColor(v141, (const cocos2d::ccColor4F *)&v171);
v171 = xmmword_1406240D0;
v141->setEndColor(v141, (const cocos2d::ccColor4F *)&v171);
if ( j )
break;
a1->m_swingBurstParticles1 = v141;
j = 1;
}
a1->m_swingBurstParticles2 = v141;
}
v142 = cocos2d::CCParticleSystemQuad::create("shipDragEffect.plist", 0);
a1->m_vehicleGroundParticles = v142;
v142->setPositionType(v142, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_vehicleGroundParticles);
cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles);
v143 = cocos2d::CCParticleSystemQuad::create("landEffect.plist", 0);
a1->m_landParticles0 = v143;
v143->setPositionType(v143, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_landParticles0);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles0);
a1->m_landParticlesAngle = a1->m_landParticles0->getAngle(a1->m_landParticles0);
a1->m_landParticleRelatedY = a1->m_landParticles0->getGravity(a1->m_landParticles0)->y;
v144 = cocos2d::CCParticleSystemQuad::create("landEffect.plist", 0);
a1->m_landParticles1 = v144;
v144->setPositionType(v144, kCCPositionTypeGrouped);
cocos2d::CCArray::addObject(a1->m_particleSystems, a1->m_landParticles1);
cocos2d::CCParticleSystem::stopSystem(a1->m_landParticles1);
PlayerObject::setupStreak(a1);
v170 = 0x100000302LL;
v145 = cocos2d::CCString::createWithFormat("player_%02d_glow_001.png", v9);
v146 = cocos2d::CCString::getCString(v145);
v186 = 0;
v187 = 0;
v188 = 0;
v147 = -1;
do
++v147;
while ( v146[v147] );
sub_14003A930(&v186, v146, v147);
v148 = (cocos2d::CCSprite *)cocos2d::CCSprite::create();
a1->m_dashSpritesContainer = v148;
v148->setTextureRect_0(v148, &stru_1406C2458);
a1->m_dashSpritesContainer->m_bDontDraw = 1;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_dashSpritesContainer, -1);
v149 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_001.png");
a1->m_dashFireSprite = v149;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v149->setBlendFunc)(
&v149->cocos2d::CCTextureProtocol,
v170);
v150 = ((float (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *))a1->m_dashSpritesContainer->addChild_1)(
a1->m_dashSpritesContainer,
a1->m_dashFireSprite);
v151 = a1->m_dashFireSprite->__vftable;
cocos2d::CCPoint::CCPoint(v150, 0.0);
v152 = cocos2d::CCNode::convertToNodeSpace(a1, (const struct cocos2d::CCPoint *)&v171);
((void (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCPoint))v151->setPosition_0)(a1->m_dashFireSprite, v152);
a1->m_dashFireSprite->setVisible(a1->m_dashFireSprite, 0);
v153 = cocos2d::CCSprite::createWithSpriteFrameName("playerDash2_outline_001.png");
a1->m_dashFireSprite->addChild_0(a1->m_dashFireSprite, v153, 1);
v154 = v153->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v155 = cocos2d::CCNode::convertToNodeSpace(a1->m_dashFireSprite, (const struct cocos2d::CCPoint *)&v171);
((void (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCPoint))v154->setPosition_0)(v153, v155);
LOBYTE(v156) = -106;
v153->setOpacity(&v153->cocos2d::CCRGBAProtocol, v156);
v157 = (const char *)&v186;
if ( v188 > 0xF )
v157 = (const char *)v186;
v158 = cocos2d::CCSprite::createWithSpriteFrameName(v157);
a1->m_iconGlow = v158;
v158->setVisible(v158, 0);
a1->m_dashSpritesContainer->addChild_0(a1->m_dashSpritesContainer, a1->m_iconGlow, 2);
v159 = cocos2d::CCString::createWithFormat("ship_%02d_glow_001.png", v11);
v160 = cocos2d::CCString::getCString(v159);
v183 = 0;
v184 = 0;
v185 = 0;
do
++v17;
while ( v160[v17] );
sub_14003A930(&v183, v160, v17);
v161 = (const char *)&v183;
if ( v185 > 0xF )
v161 = (const char *)v183;
v162 = cocos2d::CCSprite::createWithSpriteFrameName(v161);
a1->m_vehicleGlow = v162;
a1->m_dashSpritesContainer->addChild_0(a1->m_dashSpritesContainer, v162, -3);
a1->m_vehicleGlow->setVisible(a1->m_vehicleGlow, 0);
a1->m_width = 30.0;
a1->m_height = 30.0;
a1->m_unkAngle1 = 30.0;
v163 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
*(_QWORD *)&v171 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v171);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v163 = (GameManager *)qword_1406C2ED8;
}
a1->m_defaultMiniIcon = GameManager::getGameVariable(v163, "0060");
v164 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
*(_QWORD *)&v171 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v171);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v164 = (GameManager *)qword_1406C2ED8;
}
a1->m_swapColors = GameManager::getGameVariable(v164, "0061");
v165 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
*(_QWORD *)&v171 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v171);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v165 = (GameManager *)qword_1406C2ED8;
}
a1->m_switchDashFireColor = GameManager::getGameVariable(v165, "0062");
LODWORD(v170) = 0;
Myfirst = a1->m_playerFollowFloats._Mypair._Myval2._Myfirst;
v167 = a1->m_playerFollowFloats._Mypair._Myval2._Mylast - Myfirst;
if ( v167 > 0xC8 )
{
v168 = Myfirst + 200;
LABEL_121:
a1->m_playerFollowFloats._Mypair._Myval2._Mylast = v168;
goto LABEL_122;
}
if ( v167 < 0xC8 )
{
if ( (unsigned __int64)(a1->m_playerFollowFloats._Mypair._Myval2._Myend - Myfirst) >= 0xC8 )
{
v168 = (std::_Simple_types::value_type *)sub_140250800(
a1->m_playerFollowFloats._Mypair._Myval2._Mylast,
200 - v167,
&v170);
goto LABEL_121;
}
sub_1403A4600(&a1->m_playerFollowFloats, 200, &v170);
}
LABEL_122:
a1->m_quickCheckpointMode = 0;
v23 = 1;
sub_14003A830((__int64)&v183);
sub_14003A830((__int64)&v186);
sub_14003A830((__int64)&v174);
sub_14003A830((__int64)&v189);
goto LABEL_123;
}
v23 = 0;
LABEL_123:
sub_14003A830((__int64)&v177);
sub_14003A830((__int64)&v180);
return v23;
}