//
// SecretNumberLayer::playNumberEffect from 0x4ed0e8 to 0x4ed350 (616 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x4edb84
//
// 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 SecretNumberLayer::playNumberEffect(SecretNumberLayer *a1, int a2)
{
cocos2d::CCDirector *v4; // r0
const char *v5; // r1
int v6; // r5
cocos2d::CCString *v7; // r0
int v8; // r11
char *CString; // r0
int v10; // r10
cocos2d::CCString *v11; // r0
cocos2d::CCLabelBMFont *v12; // r4
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCShow *v14; // r9
cocos2d::CCFadeIn *v15; // r7
float v16; // r2
cocos2d::CCFiniteTimeAction *v17; // r0
cocos2d::CCSpawn *v18; // r8
cocos2d::CCDelayTime *v19; // r7
float v20; // r0
int v21; // r0
cocos2d::CCSequence *v22; // r7
cocos2d::CCFiniteTimeAction *v23; // r0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
int v25; // r4
int v26; // [sp+14h] [bp-50h]
char *v27; // [sp+18h] [bp-4Ch]
cocos2d::CCSequence *v28; // [sp+1Ch] [bp-48h]
cocos2d::CCFadeOut *v29; // [sp+20h] [bp-44h]
_BYTE v30[4]; // [sp+38h] [bp-2Ch] BYREF
cocos2d::CCSize v31; // [sp+3Ch] [bp-28h] BYREF
cocos2d::CCPoint v32; // [sp+44h] [bp-20h] BYREF
int v33; // [sp+4Ch] [bp-18h]
int v34; // [sp+50h] [bp-14h]
int v35; // [sp+54h] [bp-10h]
int v36; // [sp+58h] [bp-Ch]
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v31, v4);
v5 = (const char *)a2;
v6 = 0;
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v5);
v8 = 0;
CString = (char *)cocos2d::CCString::getCString(v7);
v10 = 0;
sub_776584((int)v30, CString);
v26 = 0;
v27 = (char *)(int)(float)((float)((float)rand() * 4.6566e-10) * 100.0);
while ( 1 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v27);
cocos2d::CCString::getCString(v11);
v12 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v12);
setPosition = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v32, v31.width * 0.5, (float)(v31.height * 0.5) + 94.0);
setPosition(v12, &v32);
v12->setVisible(v12, 0);
v12->setOpacity(v12, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v12->setScale)(v12, 1077936128);
v14 = cocos2d::CCShow::create();
v28 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((float)v6 * 0.55);
v15 = cocos2d::CCFadeIn::create(0.1);
v17 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCScaleTo::create((cocos2d::CCScaleTo *)0x3E4CCCCD, 1.0, v16);
v18 = cocos2d::CCSpawn::createWithTwoActions(v15, v17);
v19 = cocos2d::CCDelayTime::create(0.2);
if ( v6 == 5 )
v20 = 0.5;
else
v20 = 0.25;
v29 = cocos2d::CCFadeOut::create(v20);
v33 = 260;
v34 = 1;
v21 = cocos2d::CCCallFunc::create(v12, 260, 1);
v22 = (cocos2d::CCSequence *)cocos2d::CCSequence::create(v28, v14, v18, v19, v29, v21, 0);
if ( v6 == 5 )
{
v35 = 260;
v36 = 1;
v23 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, 260, 1);
v22 = (cocos2d::CCSequence *)cocos2d::CCSequence::create(v22, v23, 0);
setColor = v12->setColor;
LOWORD(v32.x) = -106;
BYTE2(v32.x) = -1;
setColor(v12, (const cocos2d::ccColor3B *)&v32);
}
cocos2d::CCNode::runAction(v12, v22);
if ( ++v6 == 6 )
break;
if ( v10 <= 2 && (v8 > 1 || (float)((float)rand() * 4.6566e-10) > 0.5) )
{
++v10;
v25 = 1;
}
else
{
++v8;
v25 = 2;
}
sub_776158(&v32, v30, v26, v25);
v26 += v25;
v27 += atoi((const char *)LODWORD(v32.x));
sub_774008(&v32);
}
sub_774008(v30);
}