//
// CurrencyRewardLayer::createObjectsFull from 0x1400a1c30 to 0x1400a293c (3340 bytes)
//
// 10 xrefs:
// > ChallengesPage::claimItem @ 0x140086bd6
// > CurrencyRewardLayer::init @ 0x1400a19d1
// > CurrencyRewardLayer::init @ 0x1400a1a17
// > CurrencyRewardLayer::init @ 0x1400a1a5a
// > CurrencyRewardLayer::init @ 0x1400a1ac7
// > CurrencyRewardLayer::init @ 0x1400a1b5c
// > CurrencyRewardLayer::init @ 0x1400a1b99
// > GJGarageLayer::dialogClosed @ 0x1402788bb
// > RewardUnlockLayer::playRewardEffect @ 0x1403cf94b
// > ??> @ 0x1406c76bc
//
// 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=1
void CurrencyRewardLayer::createObjectsFull(
CurrencyRewardLayer *a1,
CurrencySpriteType a2,
int a3,
cocos2d::CCSprite *a4,
cocos2d::CCPoint a5,
float a6)
{
cocos2d::CCSprite *v6; // rbx
cocos2d::CCPoint v10; // rsi
float m_time; // xmm8_4
float v12; // xmm10_4
__int64 v13; // rcx
cocos2d::CCDirector *v14; // rax
float v15; // xmm6_4
__int64 v16; // rcx
cocos2d::CCDirector *v17; // rax
float ScreenRight; // xmm0_4
__int64 v19; // rax
cocos2d::CCLabelBMFont *m_shardsLabel; // rcx
int v21; // eax
cocos2d::CCPoint *p_m_keysPosition; // rdx
int v23; // r8d
int v24; // r9d
int v25; // r10d
int v26; // r11d
int v27; // edx
int v28; // ebx
__m128 v29; // xmm3
__m128 v30; // xmm3
__m128 v31; // xmm3
__m128 v32; // xmm3
__m128 v33; // xmm3
__m128 v34; // xmm3
int v35; // edi
float v36; // xmm7_4
int v37; // r14d
float v38; // xmm6_4
int v39; // eax
CurrencySprite *v40; // rsi
CurrencySprite *v41; // rax
cocos2d::CCNode *m_burstSprite; // rdx
__int64 v43; // rcx
struct cocos2d::CCObject *v44; // rbx
cocos2d::CCObject *v45; // rax
float v46; // xmm6_4
CurrencySprite_vtbl *v47; // rbx
int v48; // eax
struct cocos2d::CCParticleSystemQuad *v49; // rdi
cocos2d::CCParticleSystemQuad_vtbl *v50; // rbx
cocos2d::CCParticleSystemQuad_vtbl *v51; // rbx
cocos2d::CCParticleSystemQuad_vtbl *v52; // rbx
int v53; // r14d
__int64 v54; // rsi
cocos2d::CCArray *v55; // r14
struct cocos2d::CCObject *v56; // rdi
cocos2d::CCObject_vtbl *v57; // rbx
struct cocos2d::CCParticleSystemQuad *v58; // rdi
_BOOL8 v59; // rdx
char v60; // r12
int v61; // ecx
int v62; // eax
int v63; // ebx
int v64; // esi
__m128 v65; // xmm2
__m128 v66; // xmm2
__m128 v67; // xmm3
__m128 v68; // xmm3
__m128 v69; // xmm3
cocos2d::CCParticleSystemQuad_vtbl *v70; // rbx
cocos2d::CCParticleSystemQuad_vtbl *v71; // rbx
cocos2d::CCParticleSystemQuad_vtbl *v72; // rbx
CCCircleWave *v73; // rbx
int v74; // [rsp+30h] [rbp-D0h]
__int16 v75; // [rsp+30h] [rbp-D0h]
bool v76; // [rsp+34h] [rbp-CCh]
cocos2d::CCPoint v77; // [rsp+40h] [rbp-C0h] BYREF
int v78; // [rsp+48h] [rbp-B8h]
__m128 v79; // [rsp+50h] [rbp-B0h] BYREF
cocos2d::CCSprite *v80; // [rsp+60h] [rbp-A0h]
cocos2d::CCPoint v81; // [rsp+68h] [rbp-98h] BYREF
cocos2d::CCPoint v82; // [rsp+70h] [rbp-90h]
cocos2d::CCSpriteBatchNode *m_orbBatchNode; // [rsp+78h] [rbp-88h]
cocos2d::CCArray *v84; // [rsp+80h] [rbp-80h]
cocos2d::CCPoint v85; // [rsp+88h] [rbp-78h] BYREF
cocos2d::CCPoint v86; // [rsp+90h] [rbp-70h] BYREF
CurrencySprite *v87; // [rsp+98h] [rbp-68h]
__m128 v88; // [rsp+A0h] [rbp-60h] BYREF
__m128 v89; // [rsp+B0h] [rbp-50h] BYREF
__int128 v90; // [rsp+C0h] [rbp-40h] BYREF
v6 = a4;
v80 = a4;
v10 = a5;
v82 = a5;
if ( a3 > 0 )
{
v76 = a3 == 1 || (unsigned int)(a2 - 1) > 2 && a2 != Moon;
v84 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
m_time = a1->m_time;
v12 = m_time * 0.30000001;
cocos2d::CCPoint::CCPoint(&v77);
if ( v6 )
{
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v13);
v15 = cocos2d::CCDirector::getScreenTop(v14) + 30.0;
v17 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v16);
ScreenRight = cocos2d::CCDirector::getScreenRight(v17);
cocos2d::CCPoint::CCPoint(&v85, ScreenRight + 30.0, v15);
cocos2d::CCPoint::operator=(&v77, v19);
v90 = xmmword_140624360;
v88 = (__m128)xmmword_1406241E0;
}
else if ( a2 == Orb )
{
m_orbBatchNode = a1->m_orbBatchNode;
if ( a3 >= 10 )
{
if ( a3 <= 400 )
{
if ( a3 <= 300 )
{
if ( a3 <= 200 )
{
if ( a3 <= 100 )
{
if ( a3 <= 50 )
{
if ( a3 > 30 )
v12 = 0.40000001;
}
else
{
v12 = 0.5;
}
}
else
{
v12 = 0.60000002;
}
}
else
{
v12 = 0.69999999;
}
}
else
{
v12 = 0.80000001;
}
}
else
{
v12 = 0.89999998;
}
}
else
{
v12 = 0.2;
m_time = 0.80000001;
}
v90 = xmmword_140624300;
v88 = (__m128)xmmword_1406242A0;
cocos2d::CCPoint::operator=(&v77, &a1->m_orbsPosition);
}
else
{
m_orbBatchNode = a1->m_currencyBatchNode;
switch ( a2 )
{
case Star:
cocos2d::CCPoint::operator=(&v77, &a1->m_starsPosition);
v90 = xmmword_140624160;
v88 = (__m128)xmmword_140624120;
break;
case Moon:
cocos2d::CCPoint::operator=(&v77, &a1->m_moonsPosition);
v90 = xmmword_140624330;
v88 = (__m128)xmmword_140624310;
break;
case Star|Orb:
cocos2d::CCPoint::operator=(&v77, &a1->m_diamondsPosition);
v90 = xmmword_140624360;
v88 = (__m128)xmmword_140624340;
break;
default:
m_shardsLabel = a1->m_shardsLabel;
if ( !m_shardsLabel
|| (v21 = m_shardsLabel->getTag(m_shardsLabel), p_m_keysPosition = &a1->m_shardsPosition, v21 != a2) )
{
p_m_keysPosition = &a1->m_keysPosition;
}
cocos2d::CCPoint::operator=(&v77, p_m_keysPosition);
v23 = 255;
v24 = 255;
v25 = 255;
v26 = 255;
v27 = 255;
v28 = 255;
switch ( a2 )
{
case 4:
v27 = 150;
goto LABEL_43;
case 5:
v23 = 100;
v26 = 0;
v27 = 200;
break;
case 6:
v23 = 200;
v26 = 0;
goto LABEL_43;
case 7:
v24 = 0;
v27 = 0;
v26 = 150;
break;
case 8:
v24 = 150;
goto LABEL_42;
case 9:
v26 = 0;
v27 = 0;
goto LABEL_44;
case 16:
v24 = 200;
v26 = 0;
LABEL_42:
v27 = 0;
LABEL_43:
v25 = 0;
LABEL_44:
v28 = 0;
break;
default:
break;
}
v88.m128_i32[3] = 1065353216;
v29 = v88;
v29.m128_f32[0] = (float)v23 / 255.0;
v30 = _mm_shuffle_ps(v29, v29, 225);
v30.m128_f32[0] = (float)v24 / 255.0;
v31 = _mm_shuffle_ps(v30, v30, 198);
v31.m128_f32[0] = (float)v25 / 255.0;
v88 = _mm_shuffle_ps(v31, v31, 201);
v90 = (__int128)v88;
v88.m128_i32[3] = 1065353216;
v32 = v88;
v32.m128_f32[0] = (float)v26 / 255.0;
v33 = _mm_shuffle_ps(v32, v32, 225);
v33.m128_f32[0] = (float)v27 / 255.0;
v34 = _mm_shuffle_ps(v33, v33, 198);
v34.m128_f32[0] = (float)v28 / 255.0;
v88 = _mm_shuffle_ps(v34, v34, 201);
v6 = v80;
break;
}
}
v35 = 0;
v74 = 0;
v36 = (float)((float)(a1->m_time * 0.1) + m_time) + a6;
v37 = 0;
do
{
if ( v35 >= 60 )
break;
v78 = ++v35;
v38 = (float)rand();
v39 = rand();
cocos2d::CCPoint::CCPoint(
&v86,
(float)((float)((float)((float)v39 / 32767.0) + (float)((float)v39 / 32767.0)) - 1.0) * 10.0,
(float)((float)((float)(v38 / 32767.0) + (float)(v38 / 32767.0)) - 1.0) * 10.0);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator+)(v10, &v81);
if ( v6 )
{
v40 = CurrencySprite::createWithSprite(v6);
a1->addChild_0(a1, v40, 10);
}
else
{
v87 = (CurrencySprite *)operator new(0x2A8u);
v41 = CurrencySprite::CurrencySprite(v87);
v40 = v41;
if ( v41 )
{
if ( CurrencySprite::init(v41, a2, 0) )
{
cocos2d::CCObject::autorelease(v40);
}
else
{
((void (__fastcall *)(CurrencySprite *, __int64))v40->~CurrencySprite)(v40, 1);
v40 = nullptr;
}
}
m_orbBatchNode->addChild_1(m_orbBatchNode, v40);
}
m_burstSprite = v40->m_burstSprite;
if ( m_burstSprite )
{
a1->m_orbBatchNode->addChild_0(a1->m_orbBatchNode, m_burstSprite, -10);
v40->m_burstSprite->setPosition_0(v40->m_burstSprite, &v81);
v44 = v40->m_burstSprite;
v40->m_hasFollower = 1;
if ( !v40->m_followers )
{
v45 = (cocos2d::CCObject *)cocos2d::CCArray::create(v43);
v40->m_followers = (cocos2d::CCArray *)v45;
cocos2d::CCObject::retain(v45);
}
cocos2d::CCArray::addObject(v40->m_followers, v44);
v40->m_propagateScaleChanges = 0;
v6 = v80;
}
((void (__fastcall *)(CurrencySprite *))v40->setScale_0)(v40);
v40->setPosition_0(v40, &v81);
v40->m_unkFloat2 = (float)((float)((float)((float)rand() / 32767.0) * 3.0) + 0.0) * 4.0;
if ( (float)((float)rand() / 32767.0) <= 0.5 )
v46 = -1.0;
else
v46 = 1.0;
v40->m_unkFloat1 = (float)((float)((float)rand() / 32767.0) * 5.0) * v46;
v40->m_remaining = (float)((float)((float)rand() / 32767.0) * v12) + v36;
if ( a2 != Orb )
{
v47 = v40->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
rand();
((void (__fastcall *)(CurrencySprite *))v47->setRotation)(v40);
v6 = v80;
}
v48 = rand();
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v79,
(float)((float)((float)((float)v48 / 32767.0) + (float)((float)v48 / 32767.0)) - 1.0) * 10.0,
0.0);
cocos2d::CCPoint::operator+(&v77, &v85);
cocos2d::CCPoint::operator=(&v40->m_position, &v85);
if ( v6 || v76 )
v40->m_unkFloat2 = (float)((float)((float)((float)rand() / 32767.0) * 0.2) + 2.5) * 4.0;
cocos2d::CCArray::addObject(a1->m_objects, v40);
cocos2d::CCArray::addObject(v84, v40);
if ( v37 < 20 )
{
++v37;
v49 = cocos2d::CCParticleSystemQuad::create("fireballEffect.plist", 0);
v49->setTotalParticles(v49, 40u);
v50 = v49->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49->getStartSize(v49);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v50->setStartSize)(v49);
v51 = v49->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49->getEndSize(v49);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v51->setEndSize)(v49);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v49->setStartSizeVar)(v49);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v49->setEndSizeVar)(v49);
v49->setStartColor(v49, (const cocos2d::ccColor4F *)&v90);
v49->setEndColor(v49, (const cocos2d::ccColor4F *)&v88);
v89 = 0;
v49->setStartColorVar(v49, (const cocos2d::ccColor4F *)&v89);
v89 = 0;
v49->setEndColorVar(v49, (const cocos2d::ccColor4F *)&v89);
v52 = v49->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
rand();
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v52->setLife)(v49);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v49->setLifeVar)(v49);
v49->setPositionType(v49, kCCPositionTypeFree);
v49->setAutoRemoveOnFinish(v49, 0);
a1->addChild_0(a1, v49, -1);
v40->m_particleSystem = v49;
v49->setPosition_0(v49, &v81);
v35 = v78;
v6 = v80;
}
++v74;
v10 = v82;
}
while ( v74 < a3 );
v53 = 255;
if ( v35 < a3 )
{
v54 = (unsigned int)(a3 - v35);
v55 = v84;
do
{
v56 = cocos2d::CCArray::randomObject(v55);
++v56[11].m_uAutoReleaseCount;
if ( ((float (__fastcall *)(struct cocos2d::CCObject *))v56->__vftable[2].acceptVisitor)(v56) < 3.0 )
{
v57 = v56->__vftable;
((void (__fastcall *)(struct cocos2d::CCObject *))v56->__vftable[2].acceptVisitor)(v56);
((void (__fastcall *)(struct cocos2d::CCObject *))v57[2].isEqual)(v56);
}
--v54;
}
while ( v54 );
v53 = 255;
}
if ( !a1->m_particlesAdded || a1->m_objectsAdded )
{
a1->m_particlesAdded = 1;
v58 = cocos2d::CCParticleSystemQuad::create("explodeEffect.plist", 0);
v58->setPositionType(v58, kCCPositionTypeGrouped);
a1->addChild_0(a1, v58, 99);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *, cocos2d::CCPoint))v58->setPosition_0)(v58, v82);
LOBYTE(v59) = 1;
v58->setAutoRemoveOnFinish(v58, v59);
v75 = -1;
v60 = -1;
if ( a2 == Orb )
{
v61 = 255;
}
else
{
v62 = 255;
if ( a2 == Star )
{
LOBYTE(v75) = -1;
v60 = 0;
v61 = 0;
v63 = 255;
v53 = 0;
LABEL_84:
v64 = 150;
goto LABEL_85;
}
v61 = 255;
v63 = 150;
v64 = 255;
if ( a2 != Moon )
{
LABEL_85:
v79.m128_i32[1] = 1065353216;
v79.m128_i32[3] = 1065353216;
v65 = v79;
v65.m128_f32[0] = (float)v62 / 255.0;
v66 = _mm_shuffle_ps(v65, v65, 210);
v66.m128_f32[0] = (float)v61 / 255.0;
v79 = _mm_shuffle_ps(v66, v66, 201);
v89 = v79;
v58->setStartColor(v58, (const cocos2d::ccColor4F *)&v89);
v79.m128_i32[3] = 1065353216;
v67 = v79;
v67.m128_f32[0] = (float)v63 / 255.0;
v68 = _mm_shuffle_ps(v67, v67, 225);
v68.m128_f32[0] = (float)v64 / 255.0;
v69 = _mm_shuffle_ps(v68, v68, 198);
v69.m128_f32[0] = (float)v53 / 255.0;
v89 = _mm_shuffle_ps(v69, v69, 201);
v58->setEndColor(v58, (const cocos2d::ccColor4F *)&v89);
v89 = 0;
v58->setStartColorVar(v58, (const cocos2d::ccColor4F *)&v89);
v89 = 0;
v58->setEndColorVar(v58, (const cocos2d::ccColor4F *)&v89);
v70 = v58->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v58->getSpeed(v58);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v70->setSpeed)(v58);
v71 = v58->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v58->getStartSize(v58);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v71->setStartSize)(v58);
v72 = v58->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v58->getEndSize(v58);
((void (__fastcall *)(struct cocos2d::CCParticleSystemQuad *))v72->setEndSize)(v58);
cocos2d::CCParticleSystem::resetSystem(v58);
v73 = CCCircleWave::create(10.0, 110.0, 0.30000001, 0, 1);
*(_WORD *)&v73->m_color.r = v75;
v73->m_color.b = v60;
((void (__fastcall *)(CCCircleWave *, cocos2d::CCPoint))v73->setPosition_0)(v73, v82);
a1->addChild_0(a1, v73, 9);
return;
}
}
v62 = 0;
v63 = 0;
LOBYTE(v75) = 0;
goto LABEL_84;
}
}
}