//
// ExplodeItemNode::createSprites from 0x5667cc to 0x566cec (1312 bytes)
//
// 2 xrefs:
// > MapSelectLayer::checkTouchMonster @ 0x50ea14
// > PlayerObject::playDeathEffect @ 0x56b3d2
//
// 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 ExplodeItemNode::createSprites(
ExplodeItemNode *a1,
int a2,
int a3,
float a4,
float a5,
float a6,
float a7,
float a8,
float a9,
cocos2d::ccColor4F a10,
cocos2d::ccColor4F a11,
bool a12)
{
cocos2d::CCSprite *v16; // r0
float width; // s16
float v18; // s15
float v19; // s18
int v20; // r4
float v21; // r0
int v22; // r3
float v23; // s17
int v24; // r4
float v25; // r0
int v26; // r3
int v27; // r8
int v28; // r10
float v29; // s18
float v30; // s19
float v31; // s29
float v32; // s27
ExplodeItemSprite *v33; // r5
void (__fastcall *setTexture)(cocos2d::CCSprite *__hidden, cocos2d::CCTexture2D *); // r4
cocos2d::CCSprite *v35; // r0
int v36; // r0
void (__fastcall *setTextureRect)(cocos2d::CCSprite *__hidden, const cocos2d::CCRect *); // r11
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
int v39; // r0
int v40; // r0
int v41; // r0
float v42; // s15
int v43; // s15
cocos2d::CCArray *m_sprites; // r0
bool v45; // r2
cocos2d::CCNode *v46; // r4
cocos2d::CCGridBase *(__fastcall *getGrid)(cocos2d::CCNode *__hidden); // r11
float v48; // r0
unsigned int (__fastcall *getOrderOfArrival)(cocos2d::CCNode *__hidden); // r11
float v50; // r0
bool (__fastcall *isIgnoreAnchorPointForPosition)(cocos2d::CCNode *__hidden); // r11
float v52; // r0
unsigned int (__fastcall *getChildrenCount)(const cocos2d::CCNode *__hidden); // r2
void (__fastcall *removeFromParentAndCleanup)(cocos2d::CCNode *__hidden, bool); // r3
bool (__fastcall *init)(cocos2d::CCNode *__hidden); // r11
int v56; // r0
cocos2d::CCNode_vtbl *v57; // r3
void (__fastcall *v58)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v59; // r0
char v60; // [sp+8h] [bp-5Ch]
_BOOL4 v61; // [sp+Ch] [bp-58h]
void *v62[3]; // [sp+1Ch] [bp-48h] BYREF
void *v63[3]; // [sp+28h] [bp-3Ch] BYREF
void *v64[3]; // [sp+34h] [bp-30h] BYREF
void *v65[3]; // [sp+40h] [bp-24h] BYREF
cocos2d::CCRect v66; // [sp+4Ch] [bp-18h] BYREF
v61 = a12;
v16 = a1->m_renderTexture->getSprite(a1->m_renderTexture);
width = v16->getContentSize(v16)->width;
if ( (float)(width / (float)a2) > (float)(width / (float)a3) )
v18 = width / (float)a3;
else
v18 = width / (float)a2;
a1->m_unk1 = v18;
std::vector::vector(v62, a2);
std::vector::vector(v63, a3);
std::vector::vector(v64, a2);
std::vector::vector(v65, a3);
v19 = 0.0;
v20 = 0;
while ( v20 < a2 - 1 )
{
rand();
v21 = COERCE_FLOAT(roundf());
v22 = 4 * v20++;
v19 = v19 + v21;
*(float *)((char *)v62[0] + v22) = v21;
*(float *)((char *)v64[0] + v22 + 4) = v19;
}
v23 = 0.0;
v24 = 0;
while ( v24 < a3 - 1 )
{
rand();
v25 = COERCE_FLOAT(roundf());
v26 = 4 * v24++;
v23 = v23 + v25;
*(float *)((char *)v63[0] + v26) = v25;
*(float *)((char *)v65[0] + v26 + 4) = v23;
}
v27 = 0;
v60 = 0;
*((float *)v62[0] + a2 - 1) = width - v19;
*((float *)v63[0] + a3 - 1) = width - v23;
while ( v27 < a2 )
{
v28 = 0;
v29 = *((float *)v62[0] + v27);
v30 = *((float *)v64[0] + v27);
while ( v28 < a3 )
{
v31 = *((float *)v63[0] + v28);
v32 = *((float *)v65[0] + v28);
++v60;
v33 = ExplodeItemSprite::create();
setTexture = v33->setTexture;
v35 = a1->m_renderTexture->getSprite(a1->m_renderTexture);
v36 = (int)v35->getTexture(v35);
setTexture(v33, (cocos2d::CCTexture2D *)v36);
setTextureRect = v33->setTextureRect;
cocos2d::CCRect::CCRect(&v66, v30, v32, v29, v31);
setTextureRect(v33, &v66);
setPosition = v33->setPosition;
cocos2d::CCPoint::CCPoint(
&v66.origin,
(float)(v30 + (float)(v29 * 0.5)) - (float)(width * 0.5),
(float)(v32 + (float)(v31 * 0.5)) - (float)(width * 0.5));
setPosition(v33, &v66.origin);
cocos2d::CCSprite::setFlipY(v33, 1);
a1->addChild(a1, v33);
v39 = rand();
v33->m_yVelocity = a6
+ (float)((float)((float)((float)((float)v39 * 4.6566e-10) + (float)((float)v39 * 4.6566e-10))
- 1.0)
* a7);
v40 = rand();
v33->m_xVelocity = a4
+ (float)((float)((float)((float)((float)v40 * 4.6566e-10) + (float)((float)v40 * 4.6566e-10))
- 1.0)
* a5);
v41 = rand();
v42 = a8
+ (float)((float)((float)((float)((float)v41 * 4.6566e-10) + (float)((float)v41 * 4.6566e-10)) - 1.0) * a9);
v33->m_timeRemaining = v42;
if ( v42 > 0.5 )
v42 = 0.5;
v33->m_fadeOutTime = v42;
v43 = rand();
m_sprites = a1->m_sprites;
v33->m_rotVelocity = (float)((float)((float)((float)((float)v43 * 4.6566e-10) + (float)((float)v43 * 4.6566e-10))
- 1.0)
* 360.0)
/ 60.0;
cocos2d::CCArray::addObject(m_sprites, v33);
if ( (v60 & 1) == 0 && !v61 )
{
v46 = (cocos2d::CCNode *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"fireballEffect.plist",
nullptr,
v45);
((void (__fastcall *)(cocos2d::CCNode *, int))v46->__vftable[1].getUserData)(v46, 10);
getGrid = v46->__vftable[1].getGrid;
v48 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCNode *))v46->__vftable[1].sortAllChildren)(v46));
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))getGrid)(v46, v48 * 0.4);
getOrderOfArrival = v46->__vftable[1].getOrderOfArrival;
v50 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCNode *))v46->__vftable[1].setOrderOfArrival)(v46));
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))getOrderOfArrival)(v46, v50 * 0.8);
isIgnoreAnchorPointForPosition = v46->__vftable[1].isIgnoreAnchorPointForPosition;
v52 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCNode *))v46->__vftable[1].ignoreAnchorPointForPosition)(v46));
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))isIgnoreAnchorPointForPosition)(v46, v52 * 0.2);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v46->__vftable[1].getGLServerState)(v46, 0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v46->__vftable[1].addChild_0)(v46, 0);
v46->__vftable[1].getChildByTag(v46, (int)&a10);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::ccColor4F *))v46->__vftable[1].getParent)(v46, &a11);
getChildrenCount = v46->__vftable[1].getChildrenCount;
memset(&v66, 0, sizeof(v66));
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))getChildrenCount)(v46, &v66);
removeFromParentAndCleanup = v46->__vftable[1].removeFromParentAndCleanup;
memset(&v66, 0, sizeof(v66));
removeFromParentAndCleanup(v46, (bool)&v66);
init = v46->__vftable[1].init;
v56 = rand();
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))init)(
v46,
(float)((float)((float)v56 * 4.6566e-10) * 0.2) + 0.2);
v46->__vftable[1]._setZOrder(v46, 0);
v46->__vftable[1].registerScriptHandler(v46, 1);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v46->__vftable[1].onEnter)(v46, 0);
a1->addChild_0(a1, v46, -1);
v57 = v46->__vftable;
v33->m_particles = (cocos2d::CCParticleSystemQuad *)v46;
v58 = v57->setPosition;
v59 = (int)v33->getPosition(v33);
v58(v46, (const cocos2d::CCPoint *)v59);
}
++v28;
}
++v27;
}
cocos2d::CCNode::scheduleUpdate(a1);
std::_Vector_base::~_Vector_base(v65);
std::_Vector_base::~_Vector_base(v64);
std::_Vector_base::~_Vector_base(v63);
std::_Vector_base::~_Vector_base(v62);
}