//
// CurrencySprite::init from 0x4d0f1c to 0x4d169a (1918 bytes)
//
// 1 xrefs:
// > CurrencySprite::create @ 0x4d16ea
//
// 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
//
bool CurrencySprite::init(CurrencySprite *a1, CurrencySpriteType a2, bool a3)
{
_BOOL4 v3; // r6
char v6; // r3
float v7; // s16
char v8; // r2
char v9; // r3
char v10; // r2
char v11; // r3
char v12; // r1
cocos2d::CCSprite *v14; // r0
cocos2d::CCSprite *m_burstSprite; // r6
void (__fastcall *setScale)(cocos2d::CCSprite *__hidden, float); // r9
float v17; // r0
cocos2d::CCSprite *v18; // r6
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
float v20; // s18
int v21; // r0
float v22; // r2
cocos2d::CCActionInterval *v23; // r0
cocos2d::CCRepeatForever *v24; // r0
void (__fastcall *v25)(cocos2d::CCSprite *__hidden, float); // r8
int v26; // r0
void (__fastcall *setOpacity)(cocos2d::CCSprite *__hidden, GLubyte); // r8
cocos2d::CCSprite *v28; // r8
void (__fastcall *v29)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
int v30; // r0
float v31; // r2
cocos2d::CCActionInterval *v32; // r0
cocos2d::CCRepeatForever *v33; // r0
cocos2d::CCSprite *v34; // r6
void (__fastcall *v35)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCFadeOut *v36; // r0
cocos2d::CCEaseIn *v37; // r0
_BOOL4 v38; // [sp+0h] [bp-14h]
unsigned int v39; // [sp+Ch] [bp-8h]
__int16 v40; // [sp+10h] [bp-4h] BYREF
char v41; // [sp+12h] [bp-2h]
__int16 v42; // [sp+14h] [bp+0h] BYREF
char v43; // [sp+16h] [bp+2h]
__int16 v44; // [sp+18h] [bp+4h] BYREF
char v45; // [sp+1Ah] [bp+6h]
char *v46; // [sp+1Ch] [bp+8h] BYREF
cocos2d::CCSprite *v47; // [sp+20h] [bp+Ch] BYREF
cocos2d::CCPoint v48; // [sp+24h] [bp+10h] BYREF
v3 = a3;
v46 = (char *)&unk_ACDDA8;
v47 = (cocos2d::CCSprite *)&unk_ACDDA8;
v40 = -1;
v42 = -1;
v45 = -1;
v41 = -1;
v43 = -1;
v44 = -1;
switch ( a2 )
{
case 2:
sub_7753D4((int)&v46, "GJ_bigStar_noShadow_001.png");
sub_7753D4((int)&v47, "GJ_bigStar_glow_001.png");
v8 = -1;
v40 = -26881;
v9 = 0;
goto LABEL_7;
case 3:
sub_7753D4((int)&v46, "GJ_bigDiamond_noShadow_001.png");
sub_7753D4((int)&v47, "GJ_bigDiamond_glow_001.png");
HIBYTE(v40) = -1;
v41 = -1;
LOBYTE(v40) = (unsigned int)(float)((float)((float)((float)rand() * 4.6566e-10) * 125.0) + 130.0);
HIBYTE(v42) = -1;
v43 = -1;
LOBYTE(v42) = (unsigned int)(float)((float)((float)((float)rand() * 4.6566e-10) * 125.0) + 130.0);
HIBYTE(v44) = -1;
v45 = -1;
LOBYTE(v44) = (unsigned int)(float)((float)((float)((float)rand() * 4.6566e-10) * 175.0) + 80.0);
goto LABEL_25;
case 4:
sub_7753D4((int)&v46, "fireShardBig_001.png");
sub_7753D4((int)&v47, "shard_glow_001.png");
v40 = -26881;
v42 = -1;
LOBYTE(v44) = -1;
v11 = 100;
v41 = 0;
v43 = 0;
goto LABEL_19;
case 5:
sub_7753D4((int)&v46, "iceShardBig_001.png");
sub_7753D4((int)&v47, "shard_glow_001.png");
v42 = -256;
v40 = -56;
v9 = -1;
LOBYTE(v44) = 0;
v10 = -106;
v41 = -1;
v43 = -1;
goto LABEL_22;
case 6:
sub_7753D4((int)&v46, "poisonShardBig_001.png");
sub_7753D4((int)&v47, "shard_glow_001.png");
v10 = -1;
v9 = 0;
v40 = -106;
v42 = -106;
v12 = 100;
v41 = 0;
v43 = 0;
goto LABEL_21;
case 7:
sub_7753D4((int)&v46, "shadowShardBig_001.png");
sub_7753D4((int)&v47, "shard_glow_001.png");
v9 = -1;
v10 = 0;
v40 = 255;
v41 = -1;
v42 = 100;
v43 = -1;
LOBYTE(v44) = -1;
goto LABEL_22;
case 8:
sub_7753D4((int)&v46, "lavaShardBig_001.png");
sub_7753D4((int)&v47, "shard_glow_001.png");
v40 = -26881;
v9 = 0;
v42 = 13055;
LOBYTE(v44) = -1;
v10 = 100;
v41 = 0;
v43 = 0;
goto LABEL_22;
case 9:
sub_7753D4((int)&v46, "GJ_bigKey_001.png");
sub_7753D4((int)&v47, "GJ_bigKey_glow_001.png");
v6 = -1;
v40 = -1;
v41 = -1;
v42 = -1;
v43 = -1;
v44 = -1;
goto LABEL_4;
case 10:
sub_7753D4((int)&v46, "shard0201ShardBig_001.png");
sub_7753D4((int)&v47, "shard2_glow_001.png");
v9 = 0;
v40 = -26881;
v41 = 0;
v42 = -14081;
v43 = 0;
v44 = -26881;
goto LABEL_23;
case 11:
sub_7753D4((int)&v46, "shard0202ShardBig_001.png");
sub_7753D4((int)&v47, "shard2_glow_001.png");
v9 = 0;
v40 = 255;
v41 = 0;
v42 = 13055;
v43 = 0;
LOBYTE(v44) = -1;
goto LABEL_17;
case 12:
sub_7753D4((int)&v46, "shard0203ShardBig_001.png");
sub_7753D4((int)&v47, "shard2_glow_001.png");
v9 = -1;
v40 = -1;
v41 = -1;
v42 = -1;
v43 = -1;
LOBYTE(v44) = -1;
LABEL_17:
HIBYTE(v44) = v9;
goto LABEL_23;
case 13:
sub_7753D4((int)&v46, "shard0204ShardBig_001.png");
sub_7753D4((int)&v47, "shard2_glow_001.png");
v11 = -1;
v40 = -1;
v41 = 0;
v42 = -1;
v43 = 50;
LOBYTE(v44) = -1;
LABEL_19:
HIBYTE(v44) = v11;
v45 = 0;
goto LABEL_25;
case 14:
sub_7753D4((int)&v46, "shard0205ShardBig_001.png");
sub_7753D4((int)&v47, "shard2_glow_001.png");
v9 = -1;
v12 = -81;
v40 = -26881;
v42 = 255;
v41 = 50;
v10 = 0;
v43 = -81;
LABEL_21:
LOBYTE(v44) = v12;
goto LABEL_22;
case 15:
sub_7753D4((int)&v46, "GJ_bigMoon_noShadow_001.png");
sub_7753D4((int)&v47, "GJ_bigMoon_glow_001.png");
v9 = -1;
v8 = 0;
v40 = -27136;
LABEL_7:
LOBYTE(v42) = v8;
LOBYTE(v44) = v8;
v10 = -56;
v41 = v9;
HIBYTE(v42) = -106;
v43 = v9;
LABEL_22:
HIBYTE(v44) = v10;
LABEL_23:
v45 = v9;
goto LABEL_25;
case 16:
sub_7753D4((int)&v46, "GJ_bigGoldKey_001.png");
sub_7753D4((int)&v47, "GJ_bigGoldKey_glow_001.png");
v6 = 50;
v40 = -26881;
v42 = -26881;
v44 = -14081;
v41 = 50;
v43 = 50;
LABEL_4:
v45 = v6;
v7 = 1.5;
goto LABEL_26;
default:
sub_7753D4((int)&v46, "currencyOrb_001.png");
LABEL_25:
v7 = 1.0;
LABEL_26:
v38 = cocos2d::CCSprite::initWithSpriteFrameName(a1, v46);
if ( v38 )
{
if ( *(cocos2d::CCSprite_vtbl **)((char *)&v47->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 0xFFFFFFF4)
&& !v3 )
{
v14 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v47);
a1->m_burstSprite = v14;
((void (*)(void))v14->setScale)();
m_burstSprite = a1->m_burstSprite;
setScale = m_burstSprite->setScale;
v17 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCSprite *))m_burstSprite->getScale)(m_burstSprite));
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))setScale)(m_burstSprite, v17 * v7);
cocos2d::CCObject::retain(a1->m_burstSprite);
a1->m_burstSprite->setColor(a1->m_burstSprite, (const cocos2d::ccColor3B *)&v40);
v18 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
a1->m_burstSprite->addChild(a1->m_burstSprite, v18);
setPosition = v18->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v48, a1->m_burstSprite, &stru_AC6D54);
setPosition(v18, &v48);
v20 = -1.0;
if ( (float)((float)rand() * 4.6566e-10) > 0.5 )
v20 = 1.0;
v21 = rand();
v23 = (cocos2d::CCActionInterval *)cocos2d::CCRotateBy::create(
(cocos2d::CCRotateBy *)0x3F800000,
(float)((float)((float)((float)((float)v21 * 4.6566e-10) * 0.5) + 0.5)
* 180.0)
* v20,
v22);
v24 = cocos2d::CCRepeatForever::create(v23);
cocos2d::CCNode::runAction(v18, v24);
v25 = v18->setScale;
v26 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v25)(v18, (float)((float)v26 * 4.6566e-10) + 1.8);
setOpacity = v18->setOpacity;
v39 = (unsigned int)(float)((float)((float)((float)((float)rand() * 4.6566e-10) * 0.4) + 0.6) * 255.0);
setOpacity(v18, v39);
v18->setColor(v18, (const cocos2d::ccColor3B *)&v42);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
v18->addChild(v18, v28);
v29 = v28->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v48, v18, &stru_AC6D54);
v29(v28, &v48);
((void (__fastcall *)(cocos2d::CCSprite *, int))v28->setScale)(v28, 1061997773);
v28->setColor(v28, (const cocos2d::ccColor3B *)&v44);
v30 = rand();
v32 = (cocos2d::CCActionInterval *)cocos2d::CCRotateBy::create(
(cocos2d::CCRotateBy *)0x3F800000,
-(float)(v20
* (float)((float)((float)((float)((float)v30 * 4.6566e-10) * 0.5)
+ 0.5)
* 180.0)),
v31);
v33 = cocos2d::CCRepeatForever::create(v32);
cocos2d::CCNode::runAction(v28, v33);
v34 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v47);
a1->addChild_0(a1, v34, 10);
v35 = v34->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v48, a1, &stru_AC6D54);
v35(v34, &v48);
v36 = cocos2d::CCFadeOut::create(0.5);
v37 = cocos2d::CCEaseIn::create(v36, 1.3);
cocos2d::CCNode::runAction(v34, v37);
}
a1->m_spriteType = a2;
}
sub_774008(&v47);
sub_774008(&v46);
return v38;
}
}