//
// CurrencySprite::init from 0x1007a9d60 to 0x1007aa611 (2225 bytes)
//
// 1 xrefs:
// > CurrencySprite::create @ 0x1007a7ce9
//
// 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 __fastcall CurrencySprite::init(CurrencySprite *a1, CurrencySpriteType a2, bool a3)
{
__int64 v4; // rbx
const char *data; // rsi
bool v7; // r12
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v8; // al
const char *v9; // rdi
cocos2d::CCSprite *v10; // rax
cocos2d::CCSprite *m_burstSprite; // r15
float v12; // xmm0_4
double v13; // xmm1_8
cocos2d::CCSprite *v14; // r15
int v15; // eax
cocos2d::CCRotateBy *v16; // rax
cocos2d::CCRepeatForever *v17; // rsi
int v18; // eax
int v19; // eax
cocos2d::CCSprite *v20; // rax
cocos2d::CCNode *v21; // r13
int v22; // eax
cocos2d::CCRotateBy *v23; // rax
cocos2d::CCRepeatForever *v24; // rax
const char *v25; // rdi
cocos2d::CCSprite *v26; // r15
cocos2d::CCFadeOut *v27; // rax
cocos2d::CCEaseIn *v28; // rax
float v30; // [rsp+4h] [rbp-8Ch]
char v31; // [rsp+8h] [rbp-88h] BYREF
std::string v32; // [rsp+10h] [rbp-80h] BYREF
std::string v33; // [rsp+30h] [rbp-60h] BYREF
float v34[3]; // [rsp+50h] [rbp-40h]
__int16 v35; // [rsp+5Ch] [rbp-34h] BYREF
char v36; // [rsp+5Eh] [rbp-32h]
__int16 v37; // [rsp+60h] [rbp-30h] BYREF
char v38; // [rsp+62h] [rbp-2Eh]
__int16 v39; // [rsp+64h] [rbp-2Ch] BYREF
char v40; // [rsp+66h] [rbp-2Ah]
double v41; // 0:xmm0_8.8
double v42; // 0:xmm0_8.8
double v43; // 0:xmm0_8.8
v4 = (unsigned int)a2;
memset(&v32, 0, sizeof(v32));
memset(&v33, 0, sizeof(v33));
v36 = -1;
v35 = -1;
v38 = -1;
v37 = -1;
v40 = -1;
v39 = -1;
switch ( a2 )
{
case 2:
std::string::assign(&v32, "GJ_bigStar_noShadow_001.png");
std::string::assign(&v33, "GJ_bigStar_glow_001.png");
v36 = 0;
v35 = -26881;
v38 = 0;
v37 = -26881;
v40 = 0;
v39 = -14081;
goto LABEL_21;
case 3:
std::string::assign(&v32, "GJ_bigDiamond_noShadow_001.png");
std::string::assign(&v33, "GJ_bigDiamond_glow_001.png");
v35 = (int)(float)((float)((float)((float)rand() * 4.6566129e-10) * 125.0) + 130.0) | 0xFF00;
v36 = -1;
v37 = (int)(float)((float)((float)((float)rand() * 4.6566129e-10) * 125.0) + 130.0) | 0xFF00;
v38 = -1;
v39 = (int)(float)((float)((float)((float)rand() * 4.6566129e-10) * 175.0) + 80.0) | 0xFF00;
v40 = -1;
goto LABEL_21;
case 4:
std::string::assign(&v32, "fireShardBig_001.png");
std::string::assign(&v33, "shard_glow_001.png");
v36 = 0;
v35 = -26881;
v38 = 0;
v37 = -1;
goto LABEL_18;
case 5:
std::string::assign(&v32, "iceShardBig_001.png");
std::string::assign(&v33, "shard_glow_001.png");
v36 = -1;
v35 = -56;
v38 = -1;
v37 = -256;
v40 = -1;
v39 = -27136;
goto LABEL_21;
case 6:
std::string::assign(&v32, "poisonShardBig_001.png");
std::string::assign(&v33, "shard_glow_001.png");
v36 = 0;
v35 = -106;
v38 = 0;
v37 = -106;
v40 = 0;
v39 = -156;
goto LABEL_21;
case 7:
std::string::assign(&v32, "shadowShardBig_001.png");
std::string::assign(&v33, "shard_glow_001.png");
v36 = -1;
v35 = 255;
v38 = -1;
v37 = 100;
v40 = -1;
v39 = 255;
goto LABEL_21;
case 8:
std::string::assign(&v32, "lavaShardBig_001.png");
std::string::assign(&v33, "shard_glow_001.png");
v36 = 0;
v35 = -26881;
v38 = 0;
v37 = 13055;
LABEL_18:
v40 = 0;
v39 = 25855;
goto LABEL_21;
case 9:
std::string::assign(&v32, "GJ_bigKey_001.png");
std::string::assign(&v33, "GJ_bigKey_glow_001.png");
v36 = -1;
v35 = -1;
v38 = -1;
v37 = -1;
v40 = -1;
v39 = -1;
v34[0] = 1.5;
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_13;
goto LABEL_22;
case 10:
std::string::assign(&v32, "shard0201ShardBig_001.png");
std::string::assign(&v33, "shard2_glow_001.png");
v36 = 0;
v35 = -26881;
v38 = 0;
v37 = -14081;
v40 = 0;
v39 = -26881;
goto LABEL_21;
case 11:
std::string::assign(&v32, "shard0202ShardBig_001.png");
std::string::assign(&v33, "shard2_glow_001.png");
v36 = 0;
v35 = 255;
v38 = 0;
v37 = 13055;
v40 = 0;
v39 = 255;
goto LABEL_21;
case 12:
std::string::assign(&v32, "shard0203ShardBig_001.png");
std::string::assign(&v33, "shard2_glow_001.png");
v36 = -1;
v35 = -1;
v38 = -1;
v37 = -1;
v40 = -1;
v39 = -1;
goto LABEL_21;
case 13:
std::string::assign(&v32, "shard0204ShardBig_001.png");
std::string::assign(&v33, "shard2_glow_001.png");
v36 = 0;
v35 = -1;
v38 = 50;
v37 = -1;
v40 = 0;
v39 = -1;
goto LABEL_21;
case 14:
std::string::assign(&v32, "shard0205ShardBig_001.png");
std::string::assign(&v33, "shard2_glow_001.png");
v36 = 50;
v35 = -26881;
v38 = -81;
v37 = 255;
v40 = -1;
v39 = 175;
goto LABEL_21;
case 15:
std::string::assign(&v32, "GJ_bigMoon_noShadow_001.png");
std::string::assign(&v33, "GJ_bigMoon_glow_001.png");
v36 = -1;
v35 = -27136;
v38 = -1;
v37 = -27136;
v40 = -1;
v39 = -14336;
goto LABEL_21;
case 16:
std::string::assign(&v32, "GJ_bigGoldKey_001.png");
std::string::assign(&v33, "GJ_bigGoldKey_glow_001.png");
v36 = 50;
v35 = -26881;
v38 = 50;
v37 = -26881;
v40 = 50;
v39 = -14081;
v34[0] = 1.5;
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_22;
goto LABEL_13;
default:
std::string::assign(&v32, "currencyOrb_001.png");
LABEL_21:
v34[0] = 1.0;
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
LABEL_22:
data = v32.__r_.__value_.__l.__data_;
else
LABEL_13:
data = v32.__r_.__value_.__s.__data_;
v7 = cocos2d::CCSprite::initWithSpriteFrameName(a1, data);
v8 = v33.__r_.__value_.__s.0;
if ( !v7 )
goto LABEL_34;
if ( (*(_BYTE *)&v33.__r_.__value_.__s.0 & 1) != 0 )
{
if ( a3 || v33.__r_.__value_.__l.__size_ == 0 )
goto LABEL_33;
v9 = v33.__r_.__value_.__l.__data_;
}
else
{
if ( a3 || *(_BYTE *)&v33.__r_.__value_.__s.0 == 0 )
goto LABEL_33;
v9 = v33.__r_.__value_.__s.__data_;
}
v10 = cocos2d::CCSprite::createWithSpriteFrameName(v9);
a1->m_burstSprite = v10;
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setScale)(v10, flt_100823748[(_DWORD)v4 == 3]);
m_burstSprite = a1->m_burstSprite;
v12 = ((float (__fastcall *)(cocos2d::CCSprite *))m_burstSprite->getScale)(m_burstSprite);
*(_QWORD *)&v13 = LODWORD(v34[0]);
*(float *)&v13 = v34[0] * v12;
((void (__fastcall *)(cocos2d::CCSprite *, double))m_burstSprite->setScale)(m_burstSprite, v13);
cocos2d::CCObject::retain(a1->m_burstSprite);
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))a1->m_burstSprite->setColor)(a1->m_burstSprite, &v35);
v14 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *))a1->m_burstSprite->addChild)(
a1->m_burstSprite,
v14);
*(cocos2d::CCPoint *)&v41 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v31,
(const cocos2d::CCPoint *)a1->m_burstSprite);
((void (__fastcall *)(cocos2d::CCSprite *, char *, double))v14->setPosition)(v14, &v31, v41);
*(_QWORD *)v34 = v4;
*(float *)&v41 = (float)rand() * 4.6566129e-10;
v15 = rand();
v30 = flt_100817B30[*(float *)&v41 > 0.5];
v16 = cocos2d::CCRotateBy::create_1(
1.0,
(float)((float)((float)((float)((float)v15 * 4.6566129e-10) * 0.5) + 0.5) * 180.0) * v30);
v17 = cocos2d::CCRepeatForever::create(v16);
cocos2d::CCNode::runAction(v14, v17);
v18 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, float))v14->setScale)(v14, (float)((float)v18 * 4.6566129e-10) + 1.8);
v19 = rand();
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))v14->setOpacity)(
v14,
(unsigned __int8)(int)(float)((float)((float)((float)((float)v19 * 4.6566129e-10) * 0.40000001) + 0.60000002)
* 255.0));
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v14->setColor)(v14, &v37);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
*(float *)&v4 = v34[0];
v21 = v20;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *))v14->addChild)(v14, v20);
*(cocos2d::CCPoint *)&v42 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v31,
(const cocos2d::CCPoint *)v14);
((void (__fastcall *)(cocos2d::CCNode *, char *, double))v21->setPosition)(v21, &v31, v42);
((void (__fastcall *)(cocos2d::CCNode *, float))v21->setScale)(v21, 0.80000001);
((void (__fastcall *)(cocos2d::CCNode *, __int16 *))v21->__vftable[1].getTag)(v21, &v39);
v22 = rand();
v23 = cocos2d::CCRotateBy::create_1(
1.0,
(float)((float)((float)((float)((float)v22 * 4.6566129e-10) * 0.5) + 0.5) * -180.0) * v30);
v24 = cocos2d::CCRepeatForever::create(v23);
cocos2d::CCNode::runAction(v21, v24);
if ( (*(_BYTE *)&v33.__r_.__value_.__s.0 & 1) != 0 )
v25 = v33.__r_.__value_.__l.__data_;
else
v25 = v33.__r_.__value_.__s.__data_;
v26 = cocos2d::CCSprite::createWithSpriteFrameName(v25);
((void (__fastcall *)(CurrencySprite *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v26, 10);
*(cocos2d::CCPoint *)&v43 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v31,
(const cocos2d::CCPoint *)a1);
((void (__fastcall *)(cocos2d::CCSprite *, char *, double))v26->setPosition)(v26, &v31, v43);
v27 = cocos2d::CCFadeOut::create(0.5);
v28 = cocos2d::CCEaseIn::create(v27, 1.3);
cocos2d::CCNode::runAction(v26, v28);
v8 = v33.__r_.__value_.__s.0;
LABEL_33:
a1->m_spriteType = v4;
LABEL_34:
if ( (*(_BYTE *)&v8 & 1) != 0 )
operator delete(v33.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v32.__r_.__value_.__l.__data_);
return v7;
}
}