//
// SecretNumberLayer::playNumberEffect from 0x10030c9f4 to 0x10030cd18 (804 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x10030b430
//
// 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 SecretNumberLayer::playNumberEffect(SecretNumberLayer *a1, int a2)
{
cocos2d::CCDirector *v3; // x0
cocos2d::CCString *v4; // x0
char *CString; // x0
int v6; // w28
int v7; // w20
unsigned int v8; // w21
__int64 v9; // x19
unsigned int v10; // w24
__int64 v11; // x8
int v12; // w22
void *v13; // x23
cocos2d::CCString *v14; // x0
const char *v15; // x0
cocos2d::CCLabelBMFont *v16; // x22
__n128 v17; // q0
__n128 v18; // q1
char v19; // w23
cocos2d::CCDelayTime *v20; // x24
cocos2d::CCFadeIn *v21; // x25
cocos2d::CCScaleTo *v22; // x0
float v23; // s0
__int64 v24; // x1
__int64 v25; // x2
__int64 v26; // x3
__int64 v27; // x4
__int64 v28; // x5
__int64 v29; // x6
__int64 v30; // x7
cocos2d::CCSequence *v31; // x23
char v32; // w0
__int64 v33; // x1
__int64 v34; // x2
__int64 v35; // x3
__int64 v36; // x4
__int64 v37; // x5
__int64 v38; // x6
__int64 v39; // x7
int v41; // [xsp+40h] [xbp-D0h]
std::string v42; // [xsp+48h] [xbp-C8h] BYREF
std::string __str; // [xsp+60h] [xbp-B0h] BYREF
float v44; // [xsp+7Ch] [xbp-94h]
float v45; // [xsp+80h] [xbp-90h]
std::allocator __a; // [xsp+87h] [xbp-89h] BYREF
cocos2d::SEL_CallFunc v47; // 0:x1.16
cocos2d::SEL_CallFunc v48; // 0:x1.16
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v3);
v4 = (cocos2d::CCString *)sub_100268F4C("%i", a2);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_100009900(&__str, CString);
v6 = 0;
v7 = 0;
v41 = 0;
v8 = 0;
v9 = (unsigned int)(int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 100.0);
do
{
if ( v8 )
{
if ( v6 <= 2 )
{
if ( v7 <= 1 )
{
if ( vcvts_n_f32_s32(rand(), 0x1Fu) > 0.5 )
v10 = 1;
else
v10 = 2;
}
else
{
v10 = 1;
}
}
else
{
v10 = 2;
}
if ( v10 == 1 )
++v6;
else
++v7;
std::string::basic_string(&v42, &__str, v41, v10, &__a);
if ( SHIBYTE(v42.__r_.__value_.__r.__words[2]) < 0 )
{
v13 = (void *)v42.__r_.__value_.__r.__words[0];
v12 = atoi(v42.__r_.__value_.__l.__data_);
operator delete(v13);
}
else
{
v12 = atoi((const char *)&v42);
}
v41 += v10;
v11 = (unsigned int)(v12 + v9);
}
else
{
v11 = v9;
}
v9 = v11;
v14 = (cocos2d::CCString *)sub_100268F4C("%i", v11);
v15 = cocos2d::CCString::getCString(v14);
v16 = cocos2d::CCLabelBMFont::create_1(v15, "bigFont.fnt");
v17 = ((__n128 (__fastcall *)(SecretNumberLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v16);
v17.n128_f32[0] = v44 * 0.5;
v18.n128_f32[0] = (float)(v45 * 0.5) + 94.0;
sub_100022980(v17, v18, &v42);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v16->setPosition)(v16, &v42);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v16->setVisible)(v16, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v16->setOpacity)(v16, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v16->setScale)(v16, 3.0);
v19 = (unsigned __int8)cocos2d::CCShow::create();
v20 = cocos2d::CCDelayTime::create((float)v8 * 0.55);
v21 = cocos2d::CCFadeIn::create(0.1);
v22 = cocos2d::CCScaleTo::create_1(0.2, 1.0);
cocos2d::CCSpawn::createWithTwoActions(v21, v22);
cocos2d::CCDelayTime::create(0.2);
if ( v8 == 5 )
v23 = 0.5;
else
v23 = 0.25;
cocos2d::CCFadeOut::create(v23);
v47.ptr = (void (*)(void))520;
v47.adj = 1;
cocos2d::CCCallFunc::create(v16, v47);
v31 = sub_10018A494(v20, v24, v25, v26, v27, v28, v29, v30, v19);
if ( v8 == 5 )
{
v48.ptr = (void (*)(void))520;
v48.adj = 1;
v32 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v48);
v31 = sub_10018A494(v31, v33, v34, v35, v36, v37, v38, v39, v32);
v42.__r_.__value_.__s.__data_[2] = -1;
LOWORD(v42.__r_.__value_.__l.__data_) = -106;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v16->setColor)(v16, &v42);
}
cocos2d::CCNode::runAction(v16, v31);
++v8;
}
while ( v8 != 6 );
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}