//
// MapSelectLayer::checkTouchMonster from 0xac26dc to 0xac2bac (1232 bytes)
//
// 2 xrefs:
// > MapSelectLayer::ccTouchBegan @ 0xac2c4c
// > ??> @ 0x43480
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:01:05 +0000
//
__int64 __fastcall MapSelectLayer::checkTouchMonster(__int64 a1, cocos2d *a2)
{
unsigned int v4; // w19
unsigned int v5; // w25
__int64 v6; // x20
__int64 v7; // x28
const cocos2d::CCPoint *v8; // x2
float v9; // s0
FMODAudioEngine *v11; // x0
__int64 v12; // x28
int v13; // w0
bool v14; // w2
cocos2d::CCParticleSystem *v15; // x28
void (__fastcall *v16)(cocos2d::CCParticleSystem *, _DWORD *); // x2
__int64 v17; // x0
__int64 v18; // x2
int v19; // w2
cocos2d::CCRenderTexture *v20; // x22
const cocos2d::CCPoint *v21; // x0
cocos2d::CCRenderTexture *v22; // x1
_DWORD *v23; // x22
float v24; // s12
float v25; // s13
int v26; // w0
__int64 v27; // [xsp+C8h] [xbp+A8h]
void (__fastcall *v28)(__int64, _DWORD *); // [xsp+C8h] [xbp+A8h]
__int64 v29; // [xsp+D0h] [xbp+B0h] BYREF
_BYTE v30[8]; // [xsp+D8h] [xbp+B8h] BYREF
_DWORD v31[4]; // [xsp+E0h] [xbp+C0h] BYREF
__int64 v32[2]; // [xsp+F0h] [xbp+D0h] BYREF
void *v33; // [xsp+100h] [xbp+E0h]
v4 = 0;
v5 = 0;
while ( v4 < (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 472)) )
{
while ( 1 )
{
v6 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 472), v4);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 192LL))(v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, 0.0, 5.0);
cocos2d::CCPoint::operator+(&v29, v7);
cocos2d::ccpDistance(a2, (const cocos2d::CCPoint *)&v29, v8);
if ( v9 < 20.0 )
break;
if ( ++v4 >= (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 472)) )
return v5;
}
GJMapObject::touchMonster(v6);
v11 = (FMODAudioEngine *)*(unsigned int *)(v6 + 368);
if ( (int)v11 > 9 )
{
v12 = FMODAudioEngine::sharedEngine(v11);
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
std::string::__init(v32, "explode_11.ogg", 0xEu);
v13 = rand();
FMODAudioEngine::playEffect(
v12,
(char *)v32,
(float)((float)((float)((float)((float)v13 * 4.6566e-10) * 2.0) + -1.0) * 0.05) + 0.95,
0.0,
0.5);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
v5 = 1;
v15 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)"explodeEffect.plist",
nullptr,
v14);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)v15 + 1568LL))(v15, 2);
(*(void (__fastcall **)(_QWORD, cocos2d::CCParticleSystem *, __int64))(**(_QWORD **)(a1 + 424) + 464LL))(
*(_QWORD *)(a1 + 424),
v15,
1);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64))(*(_QWORD *)v15 + 1584LL))(v15, 1);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, __int64 *))(*(_QWORD *)v15 + 184LL))(v15, &v29);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, float))(*(_QWORD *)v15 + 160LL))(v15, 0.3);
v16 = *(void (__fastcall **)(cocos2d::CCParticleSystem *, _DWORD *))(*(_QWORD *)v15 + 1360LL);
v31[1] = 0;
v31[2] = 0;
v31[0] = 1.0;
v31[3] = 1.0;
v16(v15, v31);
cocos2d::CCParticleSystem::resetSystem(v15);
v17 = CCCircleWave::create(nullptr, 10.0, 40.0, 0.4);
v18 = *(_QWORD *)v17;
*(_WORD *)(v17 + 340) = 255;
*(_BYTE *)(v17 + 342) = 0;
v27 = v17;
(*(void (__fastcall **)(__int64, __int64 *))(v18 + 184))(v17, &v29);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 424) + 464LL))(*(_QWORD *)(a1 + 424), v27, 0);
v20 = (cocos2d::CCRenderTexture *)cocos2d::CCRenderTexture::create(
(cocos2d::CCRenderTexture *)((char *)&dword_30 + 2),
(int)&dword_30 + 2,
v19);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v6 + 336) + 344LL))(*(_QWORD *)(v6 + 336), 0);
v21 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 192LL))(v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v21);
v28 = *(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v6 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, 25.0, 25.0);
v28(v6, v31);
cocos2d::CCRenderTexture::beginWithClear(v20, 0.0, 0.0, 0.0, 0.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 752LL))(v6);
cocos2d::CCRenderTexture::end(v20);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v6 + 184LL))(v6, v30);
v23 = (_DWORD *)ExplodeItemNode::create(v20, v22);
v23[85] = -1027080192;
(*(void (__fastcall **)(_QWORD, _DWORD *, __int64))(**(_QWORD **)(a1 + 424) + 464LL))(
*(_QWORD *)(a1 + 424),
v23,
101);
(*(void (__fastcall **)(_DWORD *, _BYTE *))(*(_QWORD *)v23 + 184LL))(v23, v30);
v24 = (float)((float)((float)((float)rand() * 4.6566e-10) * 2.0) + -1.0) * 3.0;
v25 = roundf((float)((float)rand() * 4.6566e-10) * 4.0);
v26 = rand();
ExplodeItemNode::createSprites(
v23,
(unsigned int)(int)(float)(v25 + 4.0),
(unsigned int)(int)(float)(roundf((float)((float)v26 * 4.6566e-10) * 4.0) + 4.0),
1,
v24 * 0.5,
v24,
4.0,
2.0,
6.4,
0.0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 528LL))(v6, 1);
cocos2d::CCArray::removeObjectAtIndex(*(cocos2d::CCArray **)(a1 + 472), v4, 1);
}
else
{
++v4;
v5 = 1;
}
}
return v5;
}