//
// PlayLayer::showNewBest from 0x1000b52d0 to 0x1000b5dce (2814 bytes)
//
// 2 xrefs:
// > PlayLayer::destroyPlayer @ 0x1000ba56d
// > PlayLayer::destroyPlayer @ 0x1000ba62f
//
// 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
//
void __fastcall PlayLayer::showNewBest(PlayLayer *a1, bool a2, int a3, int a4, bool a5, bool a6, bool a7)
{
float v7; // xmm2_4
int v9; // xmm0_4
cocos2d::CCNode *v10; // r14
cocos2d::CCNode *v11; // rbx
int v12; // r14d
bool m_doNot; // al
__m128 v14; // xmm0
__m128 v15; // xmm1
unsigned int v16; // eax
const char *data; // rdi
cocos2d::CCSprite *v18; // r15
cocos2d::CCLabelBMFont *v19; // r12
cocos2d::CCLabelBMFont *v20; // r12
cocos2d::CCString *v21; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v23; // r12
__int64 v24; // rax
cocos2d::CCString *v25; // rax
const char *v26; // rax
cocos2d::CCLabelBMFont *v27; // r13
cocos2d::CCSprite *v28; // r12
FMODAudioEngine *v29; // rax
float v30; // xmm0_4
float v31; // xmm0_4
__int128 v32; // xmm0
__int128 v33; // xmm1
__int64 v34; // r15
float v35; // xmm0_4
cocos2d::CCString *v36; // rax
const char *v37; // rax
cocos2d::CCLabelBMFont *v38; // r13
cocos2d::CCNode *v39; // r14
cocos2d::CCSprite *v40; // r12
FMODAudioEngine *v41; // rax
float v42; // xmm1_4
float v43; // xmm0_4
__int128 v44; // xmm0
__int128 v45; // xmm1
__int64 v46; // r15
float v47; // xmm0_4
CurrencyRewardDelegate *v48; // rbx
bool v49; // r12
int v50; // r15d
CurrencyRewardLayer *v51; // r15
FMODAudioEngine *v52; // rax
cocos2d::CCNode *v53; // r14
cocos2d::CCScaleTo *v54; // rax
unsigned int v55; // r15d
unsigned int v56; // r12d
cocos2d::CCScaleTo *v57; // rax
unsigned int v58; // ebx
unsigned int v59; // r13d
unsigned int v60; // eax
cocos2d::CCAction *v61; // rax
cocos2d::CCLayerColor *v62; // r14
unsigned int v63; // ebx
unsigned int v64; // r15d
unsigned int v65; // r12d
unsigned int v66; // eax
int v67; // r9d
cocos2d::CCAction *v68; // rax
char v69; // [rsp+0h] [rbp-100h]
char v70; // [rsp+0h] [rbp-100h]
char v71[8]; // [rsp+20h] [rbp-E0h] BYREF
float v72[2]; // [rsp+28h] [rbp-D8h] BYREF
char v73; // [rsp+30h] [rbp-D0h] BYREF
_BYTE v74[23]; // [rsp+31h] [rbp-CFh] BYREF
void *v75[3]; // [rsp+48h] [rbp-B8h] BYREF
char v76; // [rsp+60h] [rbp-A0h] BYREF
_BYTE v77[23]; // [rsp+61h] [rbp-9Fh] BYREF
const cocos2d::CCPoint **v78; // [rsp+78h] [rbp-88h]
int v79; // [rsp+80h] [rbp-80h]
_BOOL4 v80; // [rsp+84h] [rbp-7Ch]
int v81; // [rsp+88h] [rbp-78h]
_BOOL4 v82; // [rsp+8Ch] [rbp-74h]
cocos2d::CCNode *v83; // [rsp+90h] [rbp-70h]
char v84[8]; // [rsp+98h] [rbp-68h] BYREF
__int128 v85; // [rsp+A0h] [rbp-60h]
std::string v86; // [rsp+B0h] [rbp-50h] BYREF
int v87; // [rsp+C8h] [rbp-38h]
bool v88; // [rsp+CFh] [rbp-31h]
float v89; // [rsp+D0h] [rbp-30h]
float v90; // [rsp+D4h] [rbp-2Ch]
v80 = a6;
v82 = a5;
v87 = a4;
v81 = a3;
if ( (a3 + a4 < 0) ^ __OFADD__(a3, a4) | (a3 + a4 == 0) )
v9 = 0;
else
v9 = 1092616192;
LODWORD(v83) = v9;
v79 = a3 + a4;
v88 = a3 + a4 > 0;
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v72);
sub_10028CBE0(v71, v72[0] * 0.5, (float)((float)(0.5 * v72[1]) + 20.0) + *(float *)&v83);
v10 = cocos2d::CCNode::create();
((void (__fastcall *)(PlayLayer *, cocos2d::CCNode *, __int64))a1->addChild_0)(a1, v10, 100);
((void (__fastcall *)(cocos2d::CCNode *, char *))v10->setPosition)(v10, v71);
v11 = v10;
v12 = v81;
if ( !a7 )
{
m_doNot = a1->m_doNot;
if ( a2 && !m_doNot )
{
v19 = cocos2d::CCLabelBMFont::create_3("New Reward!", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v19->setScale)(v19, 1.2);
sub_10028CBE0(&v86, 0.0, 5.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v19->setPosition)(v19, &v86);
sub_10028CBE0(&v86, 0.5, 0.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v19->setAnchorPoint)(v19, &v86);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v11->addChild)(v11, v19);
}
else if ( m_doNot )
{
v86.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v86.__r_.__value_.__l.0 + 1) = 5261650;
v14 = 0;
v14.f32[0] = (float)((float)rand() * 4.6566129e-10) * 90.0;
v15 = _mm_or_ps(_mm_and_ps((__m128)xmmword_1008150B0, v14), (__m128)xmmword_1008150C0);
v15.f32[0] = v15.f32[0] + v14.f32[0];
v16 = (int)_mm_round_ss((__m128)0LL, v15, 11).f32[0] - 1;
if ( v16 < 0x5A )
std::string::assign(&v86, (const std::string::value_type *)&unk_100815E90 + *((int *)&unk_100815E90 + v16));
if ( (*(_BYTE *)&v86.__r_.__value_.__s.0 & 1) != 0 )
data = v86.__r_.__value_.__l.__data_;
else
data = v86.__r_.__value_.__s.__data_;
v20 = cocos2d::CCLabelBMFont::create_3(data, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v20->setScale)(v20, 1.2);
sub_10028CBE0(v84, 0.0, 5.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v20->setPosition)(v20, v84);
sub_10028CBE0(v84, 0.5, 0.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v20->setAnchorPoint)(v20, v84);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v11->addChild)(v11, v20);
if ( (*(_BYTE *)&v86.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v86.__r_.__value_.__l.__data_);
}
else
{
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_newBest_001.png");
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v11->addChild)(v11, v18);
sub_10028CBE0(&v86, 0.5, 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v18->setAnchorPoint)(v18, &v86);
}
}
v21 = (cocos2d::CCString *)sub_1007AB580("%i%%", v69);
CString = cocos2d::CCString::getCString(v21);
v23 = cocos2d::CCLabelBMFont::create_3(CString, "bigFont.fnt");
sub_10028CBE0(&v86, 0.5, 1.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v23->setAnchorPoint)(v23, &v86);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v23->setScale)(v23, 1.1);
sub_10028CBE0(&v86, 0.0, -4.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v23->setPosition)(v23, &v86);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v11->addChild)(v11, v23);
v24 = 0;
v78 = (const cocos2d::CCPoint **)a1;
if ( v12 <= 0 )
{
v89 = -5.0;
v83 = v11;
if ( v87 <= 0 )
goto LABEL_19;
LABEL_22:
v25 = (cocos2d::CCString *)sub_1007AB580("+%i", v70);
v26 = cocos2d::CCString::getCString(v25);
v27 = cocos2d::CCLabelBMFont::create_3(v26, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v27->setScale)(v27, 0.60000002);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v11->addChild)(v11, v27);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigDiamond_001.png");
sub_10028CBE0(&v86, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v28->setAnchorPoint)(v28, &v86);
((void (__fastcall *)(cocos2d::CCSprite *, float))v28->setScale)(v28, 0.55000001);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v11->addChild)(v11, v28);
if ( !v82 )
{
v29 = FMODAudioEngine::sharedEngine();
v73 = 20;
strcpy(v74, "gold02.ogg");
FMODAudioEngine::playEffect_1(v29, &v73);
if ( (v73 & 1) != 0 )
operator delete(*(void **)&v74[15]);
}
if ( v12 <= 0 )
{
LODWORD(v85) = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getContentSize)(v27);
v31 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getScale)(v27);
*(float *)&v85 = (float)(v31 * *(float *)&v85) + 1.0;
v90 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v28->getContentSize)(v28);
v32 = LODWORD(v90);
*(double *)&v32 = ((double (__fastcall *)(cocos2d::CCSprite *))v28->getScale)(v28);
v33 = v32;
*(float *)&v33 = (float)((float)(*(float *)&v32 * v90) + *(float *)&v85) * 0.5;
v85 = v33;
v90 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getContentSize)(v27);
*(float *)&v32 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getScale)(v27);
v30 = -(float)(*(float *)&v85 - (float)((float)(*(float *)&v32 * v90) * 0.5));
}
else
{
v30 = 40.0;
}
sub_10028CBE0(&v86, v30 + v89, -62.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v27->setPosition)(v27, &v86);
v34 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getPosition)(v27);
*(float *)&v85 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getContentSize)(v27) * 0.5;
v35 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v27->getScale)(v27);
sub_10028CBE0(v84, (float)(v35 * *(float *)&v85) + 1.0, -1.0);
sub_10028CCE0(&v86, v34);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v28->setPosition)(v28, &v86);
if ( v12 <= 0 )
goto LABEL_35;
goto LABEL_29;
}
LOBYTE(v24) = v87 > 0;
v89 = flt_100815CE0[v24];
v83 = v11;
if ( v87 > 0 )
goto LABEL_22;
LABEL_19:
if ( v12 <= 0 )
goto LABEL_40;
LABEL_29:
v36 = (cocos2d::CCString *)sub_1007AB580("+%i", v70);
v37 = cocos2d::CCString::getCString(v36);
v38 = cocos2d::CCLabelBMFont::create_3(v37, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v38->setScale)(v38, 0.60000002);
v39 = v83;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v83->addChild)(v83, v38);
v40 = cocos2d::CCSprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
sub_10028CBE0(&v86, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v40->setAnchorPoint)(v40, &v86);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v39->addChild)(v39, v40);
v41 = FMODAudioEngine::sharedEngine();
strcpy((char *)v75, "$magicExplosion.ogg");
FMODAudioEngine::playEffect_1(v41, v75);
if ( ((__int64)v75[0] & 1) != 0 )
operator delete(v75[2]);
if ( v87 <= 0 )
{
LODWORD(v85) = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getContentSize)(v38);
v43 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getScale)(v38);
*(float *)&v85 = (float)(v43 * *(float *)&v85) + 5.0;
v90 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v40->getContentSize)(v40);
v44 = LODWORD(v90);
*(double *)&v44 = ((double (__fastcall *)(cocos2d::CCSprite *))v40->getScale)(v40);
v45 = v44;
*(float *)&v45 = (float)((float)(*(float *)&v44 * v90) + *(float *)&v85) * 0.5;
v85 = v45;
v90 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getContentSize)(v38);
*(float *)&v44 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getScale)(v38);
v42 = -(float)(*(float *)&v85 - (float)((float)(*(float *)&v44 * v90) * 0.5));
}
else
{
v42 = -40.0;
}
sub_10028CBE0(&v86, v89 + v42, -62.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v38->setPosition)(v38, &v86);
v46 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getPosition)(v38);
v89 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getContentSize)(v38) * 0.5;
v47 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v38->getScale)(v38);
sub_10028CBE0(v84, (float)(v47 * v89) + 5.0, -0.5);
sub_10028CCE0(&v86, v46);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v40->setPosition)(v40, &v86);
LABEL_35:
v48 = (CurrencyRewardDelegate *)v78;
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v86, v78[404]);
v49 = v82;
v50 = v82;
LODWORD(v89) = 9 * v82;
sub_10028CC60(v84);
v51 = CurrencyRewardLayer::create(
v81,
0,
0,
v87,
SLODWORD(v89),
v50,
Icon,
0,
0,
(CurrencyRewardType)v84,
0.89999998,
v7);
((void (__fastcall *)(CurrencyRewardDelegate *, CurrencyRewardLayer *, __int64))v48->__vftable[56].currencyWillExit)(
v48,
v51,
101);
if ( v49 )
{
v52 = FMODAudioEngine::sharedEngine();
v76 = 26;
strcpy(v77, "secretKey.ogg");
FMODAudioEngine::playEffect_1(v52, &v76);
if ( (v76 & 1) != 0 )
operator delete(*(void **)&v77[15]);
}
if ( !v80 )
v51->m_delegate = v48 + 1711;
LABEL_40:
v87 = dword_100815CD8[v88];
v53 = v83;
((void (__fastcall *)(cocos2d::CCNode *, float))v83->setScale)(v83, 0.0099999998);
v54 = cocos2d::CCScaleTo::create_1(0.40000001, 1.0);
v55 = (unsigned int)cocos2d::CCEaseElasticOut::create(v54, 0.60000002);
v56 = (unsigned int)cocos2d::CCDelayTime::create(*(float *)&v87);
v57 = cocos2d::CCScaleTo::create(0.2, 0.0099999998, 0.0099999998);
v58 = (unsigned int)cocos2d::CCEaseIn::create(v57, 2.0);
v59 = (unsigned int)cocos2d::CCHide::create();
v60 = (unsigned int)cocos2d::CCCallFunc::create(v53, (cocos2d::SEL_CallFunc)0x209uLL);
v61 = (cocos2d::CCAction *)sub_1003B5760(v55, v56, v58, v59, v60, 0);
cocos2d::CCNode::runAction(v53, v61);
if ( v79 > 0 )
{
*(_DWORD *)&v86.__r_.__value_.__l.0 = 0;
v62 = cocos2d::CCLayerColor::create_1((const cocos2d::ccColor4B *)&v86);
((void (__fastcall *)(const cocos2d::CCPoint **, cocos2d::CCLayerColor *, __int64))(*v78)[56])(v78, v62, 99);
v63 = (unsigned int)cocos2d::CCFadeTo::create(0.30000001, 0x64u);
v64 = (unsigned int)cocos2d::CCDelayTime::create(1.5999999);
v65 = (unsigned int)cocos2d::CCFadeTo::create(0.40000001, 0);
v66 = (unsigned int)cocos2d::CCCallFunc::create(v62, (cocos2d::SEL_CallFunc)0x209uLL);
v68 = (cocos2d::CCAction *)sub_1003B5760(v63, v64, v65, v66, 0, v67);
cocos2d::CCNode::runAction(v62, v68);
}
}