//
// MapSelectLayer::checkTouchMonster from 0x50e704 to 0x50ea62 (862 bytes)
//
// 1 xrefs:
// > MapSelectLayer::ccTouchBegan @ 0x50eaee
//
// 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 MapSelectLayer::checkTouchMonster(MapSelectLayer *a1, cocos2d::CCPoint a2)
{
unsigned int v2; // r6
bool v4; // r8
GJMapObject *v5; // r5
int v6; // r10
FMODAudioEngine *v7; // r8
int v8; // r0
bool v9; // r2
cocos2d::CCParticleSystem *v10; // r10
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // r8
CCCircleWave *v12; // r0
cocos2d::CCNode *v13; // r10
CCCircleWave_vtbl *v14; // r3
int v15; // r2
cocos2d::CCRenderTexture *v16; // r9
const cocos2d::CCPoint *v17; // r0
ExplodeItemNode *v18; // r9
int v19; // r0
float v20; // s16
float v21; // s19
float v22; // r0
float x; // [sp+38h] [bp-3Ch]
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+44h] [bp-30h]
cocos2d::CCPoint v26; // [sp+4Ch] [bp-28h] BYREF
cocos2d::CCPoint v27; // [sp+54h] [bp-20h] BYREF
cocos2d::ccColor4F v28; // [sp+5Ch] [bp-18h] BYREF
v2 = 0;
v4 = 0;
x = a2.x;
while ( v2 < cocos2d::CCArray::count(a1->m_monsters) )
{
v5 = (GJMapObject *)cocos2d::CCArray::objectAtIndex(a1->m_monsters, v2);
v6 = (int)v5->getPosition(v5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 0.0, 5.0);
cocos2d::CCPoint::operator+(&v26, v6, &v28);
if ( cocos2d::ccpDistance((const cocos2d::CCPoint *)LODWORD(x), &v26) >= 20.0 )
{
++v2;
}
else
{
GJMapObject::touchMonster(v5);
if ( v5->m_monstersTouched <= 9 )
{
++v2;
}
else
{
v7 = FMODAudioEngine::sharedEngine();
sub_776584((int)&v28, "explode_11.ogg");
v8 = rand();
FMODAudioEngine::playEffect(
v7,
(int)&v28,
(float)((float)((float)((float)((float)v8 * 4.6566e-10) + (float)((float)v8 * 4.6566e-10)) - 1.0) * 0.05)
+ 0.95,
0,
COERCE_INT(0.5));
sub_774008(&v28);
v10 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"explodeEffect.plist",
nullptr,
v9);
v10->setPositionType(v10, kCCPositionTypeGrouped);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v10, 1);
v10->setAutoRemoveOnFinish(v10, 1);
v10->setPosition(v10, &v26);
((void (__fastcall *)(cocos2d::CCParticleSystem *, int))v10->setScale)(v10, 1050253722);
setStartColor = v10->setStartColor;
memset(&v28, 0, sizeof(v28));
v28.a = 1.0;
v28.r = 1.0;
setStartColor(v10, &v28);
cocos2d::CCParticleSystem::resetSystem(v10);
v12 = CCCircleWave::create(10.0, 40.0, 0.4, 0);
v12->m_color.r = -1;
v13 = v12;
v14 = v12->__vftable;
v12->m_color.g = 0;
v12->m_color.b = 0;
v14->setPosition(v12, &v26);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v13, 0);
v16 = (cocos2d::CCRenderTexture *)cocos2d::CCRenderTexture::create(
(cocos2d::CCRenderTexture *)&word_32,
(int)&word_32,
v15);
v5->m_shadowSprite->setVisible(v5->m_shadowSprite, 0);
v17 = v5->getPosition(v5);
cocos2d::CCPoint::CCPoint(&v27, v17);
setPosition = v5->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 25.0, 25.0);
setPosition(v5, (const cocos2d::CCPoint *)&v28);
cocos2d::CCRenderTexture::beginWithClear(v16, 0.0, 0.0, 0.0, 0.0);
v5->visit(v5);
cocos2d::CCRenderTexture::end(v16);
v5->setPosition(v5, &v27);
v18 = ExplodeItemNode::create(v16);
v18->m_floorHeight = -100.0;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v18, 101);
v18->setPosition(v18, &v27);
v28.a = 1.0;
v28.r = 1.0;
v28.g = 1.0;
v28.b = 1.0;
v19 = rand();
v20 = (float)((float)((float)((float)v19 * 4.6566e-10) + (float)((float)v19 * 4.6566e-10)) - 1.0) * 3.0;
rand();
v21 = COERCE_FLOAT(roundf());
rand();
v22 = COERCE_FLOAT(roundf());
ExplodeItemNode::createSprites(
v18,
(int)(v21 + 4.0),
(int)(v22 + 4.0),
v20 * 0.5,
v20,
4.0,
2.0,
6.4,
0.0,
v28,
v28,
1);
v5->removeFromParentAndCleanup(v5, 1);
cocos2d::CCArray::removeObjectAtIndex(a1->m_monsters, v2, 1);
}
v4 = 1;
}
}
return v4;
}